mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
iio: proximity: Remove dev_err_probe() if error is -ENOMEM
The dev_err_probe() doesn't do anything when the error is '-ENOMEM'. Therefore, remove the useless call to dev_err_probe(), and just return the value instead. Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://patch.msgid.link/20250821080723.525379-7-zhao.xichao@vivo.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
committed by
Jonathan Cameron
parent
660586969e
commit
7216d7b9be
@@ -722,8 +722,7 @@ static int d3323aa_probe(struct platform_device *pdev)
|
||||
|
||||
indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
|
||||
if (!indio_dev)
|
||||
return dev_err_probe(dev, -ENOMEM,
|
||||
"Could not allocate iio device\n");
|
||||
return -ENOMEM;
|
||||
|
||||
data = iio_priv(indio_dev);
|
||||
data->dev = dev;
|
||||
|
||||
@@ -1141,8 +1141,7 @@ static int hx9023s_probe(struct i2c_client *client)
|
||||
indio_dev->name,
|
||||
iio_device_id(indio_dev));
|
||||
if (!data->trig)
|
||||
return dev_err_probe(dev, -ENOMEM,
|
||||
"iio trigger alloc failed\n");
|
||||
return -ENOMEM;
|
||||
|
||||
data->trig->ops = &hx9023s_trigger_ops;
|
||||
iio_trigger_set_drvdata(data->trig, indio_dev);
|
||||
|
||||
@@ -862,8 +862,7 @@ static int irsd200_probe(struct i2c_client *client)
|
||||
|
||||
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
|
||||
if (!indio_dev)
|
||||
return dev_err_probe(&client->dev, -ENOMEM,
|
||||
"Could not allocate iio device\n");
|
||||
return -ENOMEM;
|
||||
|
||||
data = iio_priv(indio_dev);
|
||||
data->dev = &client->dev;
|
||||
@@ -916,8 +915,7 @@ static int irsd200_probe(struct i2c_client *client)
|
||||
trigger = devm_iio_trigger_alloc(data->dev, "%s-dev%d", indio_dev->name,
|
||||
iio_device_id(indio_dev));
|
||||
if (!trigger)
|
||||
return dev_err_probe(data->dev, -ENOMEM,
|
||||
"Could not allocate iio trigger\n");
|
||||
return -ENOMEM;
|
||||
|
||||
trigger->ops = &irsd200_trigger_ops;
|
||||
iio_trigger_set_drvdata(trigger, data);
|
||||
|
||||
Reference in New Issue
Block a user