iio: adc: 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: Martin Blumenstingl <martin.blumenstingl@googlemail.com> # meson_saradc
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250821080723.525379-3-zhao.xichao@vivo.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Xichao Zhao
2025-08-21 16:06:46 +08:00
committed by Jonathan Cameron
parent 666a22bb31
commit 3a4cdd1155
9 changed files with 10 additions and 16 deletions

View File

@@ -465,7 +465,7 @@ static int hx711_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(struct hx711_data));
if (!indio_dev)
return dev_err_probe(dev, -ENOMEM, "failed to allocate IIO device\n");
return -ENOMEM;
hx711_data = iio_priv(indio_dev);
hx711_data->dev = dev;

View File

@@ -320,8 +320,7 @@ static int imx93_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*adc));
if (!indio_dev)
return dev_err_probe(dev, -ENOMEM,
"Failed allocating iio device\n");
return -ENOMEM;
adc = iio_priv(indio_dev);
adc->dev = dev;

View File

@@ -1019,7 +1019,7 @@ static int mcp3564_parse_fw_children(struct iio_dev *indio_dev)
channels = devm_kcalloc(dev, num_ch, sizeof(*channels), GFP_KERNEL);
if (!channels)
return dev_err_probe(dev, -ENOMEM, "Can't allocate memory\n");
return -ENOMEM;
device_for_each_child_node_scoped(dev, child) {
node_name = fwnode_get_name(child);

View File

@@ -1357,7 +1357,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
if (!indio_dev)
return dev_err_probe(dev, -ENOMEM, "failed allocating iio device\n");
return -ENOMEM;
priv = iio_priv(indio_dev);
init_completion(&priv->done);

View File

@@ -466,8 +466,7 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*info));
if (!indio_dev)
return dev_err_probe(&pdev->dev, -ENOMEM,
"failed allocating iio device\n");
return -ENOMEM;
info = iio_priv(indio_dev);

View File

@@ -275,8 +275,7 @@ static int spear_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(dev, sizeof(struct spear_adc_state));
if (!indio_dev)
return dev_err_probe(dev, -ENOMEM,
"failed allocating iio device\n");
return -ENOMEM;
st = iio_priv(indio_dev);
st->dev = dev;

View File

@@ -693,8 +693,7 @@ static int ads1119_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(dev, sizeof(*st));
if (!indio_dev)
return dev_err_probe(dev, -ENOMEM,
"Failed to allocate IIO device\n");
return -ENOMEM;
st = iio_priv(indio_dev);
st->client = client;
@@ -750,8 +749,7 @@ static int ads1119_probe(struct i2c_client *client)
indio_dev->name,
iio_device_id(indio_dev));
if (!st->trig)
return dev_err_probe(dev, -ENOMEM,
"Failed to allocate IIO trigger\n");
return -ENOMEM;
st->trig->ops = &ads1119_trigger_ops;
iio_trigger_set_drvdata(st->trig, indio_dev);

View File

@@ -355,8 +355,7 @@ static int ads7924_probe(struct i2c_client *client)
indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
if (!indio_dev)
return dev_err_probe(dev, -ENOMEM,
"failed to allocate iio device\n");
return -ENOMEM;
data = iio_priv(indio_dev);

View File

@@ -832,7 +832,7 @@ static int vf610_adc_probe(struct platform_device *pdev)
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(struct vf610_adc));
if (!indio_dev)
return dev_err_probe(&pdev->dev, -ENOMEM, "Failed allocating iio device\n");
return -ENOMEM;
info = iio_priv(indio_dev);
info->dev = &pdev->dev;