Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: proximity: Drop unnecessary -ENOMEM messages

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>

authored by

Dixit Parmar and committed by
Jonathan Cameron
1f6fcf7f b5e04043

+2 -6
+1 -3
drivers/iio/proximity/ping.c
··· 280 280 struct iio_dev *indio_dev; 281 281 282 282 indio_dev = devm_iio_device_alloc(dev, sizeof(struct ping_data)); 283 - if (!indio_dev) { 284 - dev_err(dev, "failed to allocate IIO device\n"); 283 + if (!indio_dev) 285 284 return -ENOMEM; 286 - } 287 285 288 286 data = iio_priv(indio_dev); 289 287 data->dev = dev;
+1 -3
drivers/iio/proximity/srf04.c
··· 253 253 int ret; 254 254 255 255 indio_dev = devm_iio_device_alloc(dev, sizeof(struct srf04_data)); 256 - if (!indio_dev) { 257 - dev_err(dev, "failed to allocate IIO device\n"); 256 + if (!indio_dev) 258 257 return -ENOMEM; 259 - } 260 258 261 259 data = iio_priv(indio_dev); 262 260 data->dev = dev;