]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
iio: light: Remove dev_err_probe() if error is -ENOMEM
authorXichao Zhao <zhao.xichao@vivo.com>
Thu, 21 Aug 2025 08:06:49 +0000 (16:06 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 25 Aug 2025 08:40:45 +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-6-zhao.xichao@vivo.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/opt4060.c
drivers/iio/light/veml6040.c

index aa10400e0a1f0148f9eed598785e18976b58e78f..981c704e7df56ea14f160648acc7bdd40b5f1e1b 100644 (file)
@@ -1212,7 +1212,7 @@ static int opt4060_setup_trigger(struct opt4060_chip *chip, struct iio_dev *idev
        name = devm_kasprintf(chip->dev, GFP_KERNEL, "%s-opt4060",
                              dev_name(chip->dev));
        if (!name)
-               return dev_err_probe(chip->dev, -ENOMEM, "Failed to alloc chip name\n");
+               return -ENOMEM;
 
        ret = devm_request_threaded_irq(chip->dev, chip->irq, NULL, opt4060_irq_thread,
                                        IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
index 71a594b2ec8588046562417f2a84d7114efe71f1..f563f9f0ee67c2f73750dec3e8f7850fc65ff93b 100644 (file)
@@ -219,8 +219,7 @@ static int veml6040_probe(struct i2c_client *client)
 
        indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
        if (!indio_dev)
-               return dev_err_probe(dev, -ENOMEM,
-                                    "IIO device allocation failed\n");
+               return -ENOMEM;
 
        regmap = devm_regmap_init_i2c(client, &veml6040_regmap_config);
        if (IS_ERR(regmap))