]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: chemical: Remove dev_err_probe() if error is -ENOMEM
authorXichao Zhao <zhao.xichao@vivo.com>
Thu, 21 Aug 2025 08:06:47 +0000 (16:06 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 08:40:24 +0000 (09:40 +0100)
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: Gustavo Silva <gustavograzs@gmail.com> # for ens160
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://patch.msgid.link/20250821080723.525379-4-zhao.xichao@vivo.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/chemical/ens160_core.c
drivers/iio/chemical/scd30_core.c

index 6cec600748272dbfa1772dc25536722907d08e37..86bde4a91bf7ee20200bcfba31aab883a19d5d61 100644 (file)
@@ -305,8 +305,7 @@ static int ens160_setup_trigger(struct iio_dev *indio_dev, int irq)
        trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name,
                                      iio_device_id(indio_dev));
        if (!trig)
-               return dev_err_probe(dev, -ENOMEM,
-                                    "failed to allocate trigger\n");
+               return -ENOMEM;
 
        trig->ops = &ens160_trigger_ops;
        iio_trigger_set_drvdata(trig, indio_dev);
index 5df1926cd5d985a60c7095f692a63093d522d434..a665fcb78806fac47e6ca0f0a3df8e109b03565a 100644 (file)
@@ -635,7 +635,7 @@ static int scd30_setup_trigger(struct iio_dev *indio_dev)
        trig = devm_iio_trigger_alloc(dev, "%s-dev%d", indio_dev->name,
                                      iio_device_id(indio_dev));
        if (!trig)
-               return dev_err_probe(dev, -ENOMEM, "failed to allocate trigger\n");
+               return -ENOMEM;
 
        trig->ops = &scd30_trigger_ops;
        iio_trigger_set_drvdata(trig, indio_dev);