[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250821080723.525379-6-zhao.xichao@vivo.com>
Date: Thu, 21 Aug 2025 16:06:49 +0800
From: Xichao Zhao <zhao.xichao@...o.com>
To: Jonathan Cameron <jic23@...nel.org>,
David Lechner <dlechner@...libre.com>,
Nuno Sá <nuno.sa@...log.com>,
Andy Shevchenko <andy@...nel.org>,
Per-Daniel Olsson <perdaniel.olsson@...s.com>,
linux-iio@...r.kernel.org (open list:IIO SUBSYSTEM AND DRIVERS),
linux-kernel@...r.kernel.org (open list)
Cc: Xichao Zhao <zhao.xichao@...o.com>
Subject: [PATCH 5/7] iio: light: Remove dev_err_probe() if error is -ENOMEM
The dev_err_probe() doesn't do anything when 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@...o.com>
---
drivers/iio/light/opt4060.c | 2 +-
drivers/iio/light/veml6040.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/light/opt4060.c b/drivers/iio/light/opt4060.c
index 566f1bb8fe2a..e96687700c91 100644
--- a/drivers/iio/light/opt4060.c
+++ b/drivers/iio/light/opt4060.c
@@ -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,
diff --git a/drivers/iio/light/veml6040.c b/drivers/iio/light/veml6040.c
index 71a594b2ec85..f563f9f0ee67 100644
--- a/drivers/iio/light/veml6040.c
+++ b/drivers/iio/light/veml6040.c
@@ -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))
--
2.34.1
Powered by blists - more mailing lists