]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: proximity: Remove dev_err_probe() if error is -ENOMEM
authorXichao Zhao <zhao.xichao@vivo.com>
Thu, 21 Aug 2025 08:06:50 +0000 (16:06 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 08:40:55 +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: 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>
drivers/iio/proximity/d3323aa.c
drivers/iio/proximity/hx9023s.c
drivers/iio/proximity/irsd200.c

index d4c3dbea9bb0c78dbb42c176c82e417cc2a3d7ad..30821f583454721a71e03a9f07a2321af03f3338 100644 (file)
@@ -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;
index 33781c3147286fb3e2f022201ccf7e908d0b6b12..2918dfc0df547ceaf82e9c9f2a2c532444038a23 100644 (file)
@@ -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);
index 253e4aef22fbdca84a0f8393d6f423385c8dcda8..65af31d43453128ecfd083ffca2e9f8fcbf95854 100644 (file)
@@ -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);