]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: humidity: Drop unnecessary -ENOMEM messages
authorDixit Parmar <dixitparmar19@gmail.com>
Fri, 22 Aug 2025 03:49:53 +0000 (09:19 +0530)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 11:35:39 +0000 (12:35 +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-5-db87f2974552@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/humidity/am2315.c
drivers/iio/humidity/dht11.c

index f021c3e6d88691de58084e83e0c5c5b03a1bb893..02ca23eb899115e37b83ae412b4cc052a9622854 100644 (file)
@@ -224,10 +224,8 @@ static int am2315_probe(struct i2c_client *client)
        struct am2315_data *data;
 
        indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
-       if (!indio_dev) {
-               dev_err(&client->dev, "iio allocation failed!\n");
+       if (!indio_dev)
                return -ENOMEM;
-       }
 
        data = iio_priv(indio_dev);
        data->client = client;
index 73d2033954e785b31712e1fdc515bb4f4d26e047..980cb946bbf738a5a23c0ab715c126f7f94c85ee 100644 (file)
@@ -294,10 +294,8 @@ static int dht11_probe(struct platform_device *pdev)
        struct iio_dev *iio;
 
        iio = devm_iio_device_alloc(dev, sizeof(*dht11));
-       if (!iio) {
-               dev_err(dev, "Failed to allocate IIO device\n");
+       if (!iio)
                return -ENOMEM;
-       }
 
        dht11 = iio_priv(iio);
        dht11->dev = dev;