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

iio: light: Remove dev_err_probe() if error is -ENOMEM

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-6-zhao.xichao@vivo.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Xichao Zhao and committed by
Jonathan Cameron
66058696 d3a7db87

+2 -3
+1 -1
drivers/iio/light/opt4060.c
··· 1212 1212 name = devm_kasprintf(chip->dev, GFP_KERNEL, "%s-opt4060", 1213 1213 dev_name(chip->dev)); 1214 1214 if (!name) 1215 - return dev_err_probe(chip->dev, -ENOMEM, "Failed to alloc chip name\n"); 1215 + return -ENOMEM; 1216 1216 1217 1217 ret = devm_request_threaded_irq(chip->dev, chip->irq, NULL, opt4060_irq_thread, 1218 1218 IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+1 -2
drivers/iio/light/veml6040.c
··· 219 219 220 220 indio_dev = devm_iio_device_alloc(dev, sizeof(*data)); 221 221 if (!indio_dev) 222 - return dev_err_probe(dev, -ENOMEM, 223 - "IIO device allocation failed\n"); 222 + return -ENOMEM; 224 223 225 224 regmap = devm_regmap_init_i2c(client, &veml6040_regmap_config); 226 225 if (IS_ERR(regmap))