]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: proximity: Drop unnecessary -ENOMEM messages
authorDixit Parmar <dixitparmar19@gmail.com>
Fri, 22 Aug 2025 03:49:57 +0000 (09:19 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 11:37:11 +0000 (12:37 +0100)
The drivers do not require their own error messages for error
-ENOMEM, memory allocation failures. So remove the dev_err()
messages from the probe().

Signed-off-by: Dixit Parmar <dixitparmar19@gmail.com>
Link: https://patch.msgid.link/20250822-enomam_logs-v1-9-db87f2974552@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/ping.c
drivers/iio/proximity/srf04.c

index c5b4e1378b7d1b40db0c851af461fbef2e19e786..e3487094d7be5fe9e78362b2c54d05b3d7e9378b 100644 (file)
@@ -280,10 +280,8 @@ static int ping_probe(struct platform_device *pdev)
        struct iio_dev *indio_dev;
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(struct ping_data));
-       if (!indio_dev) {
-               dev_err(dev, "failed to allocate IIO device\n");
+       if (!indio_dev)
                return -ENOMEM;
-       }
 
        data = iio_priv(indio_dev);
        data->dev = dev;
index b059bac1078bd09211fbee7bbd5ff7f3cb47e153..f9d32f9aba1f943010185595994bf83d80e75d8a 100644 (file)
@@ -253,10 +253,8 @@ static int srf04_probe(struct platform_device *pdev)
        int ret;
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(struct srf04_data));
-       if (!indio_dev) {
-               dev_err(dev, "failed to allocate IIO device\n");
+       if (!indio_dev)
                return -ENOMEM;
-       }
 
        data = iio_priv(indio_dev);
        data->dev = dev;