[PATCH v2] iio: light: tsl2591: return actual error from probe IRQ failure

From: Stepan Ionichev

Date: Mon May 18 2026 - 05:44:08 EST


When devm_request_threaded_irq() fails, probe logs the error and
then returns -EINVAL, dropping the real error code and breaking the
deferred-probe flow for -EPROBE_DEFER.

Return ret directly; the IRQ subsystem already prints on failure.

Fixes: 2335f0d7c790 ("iio: light: Added AMS tsl2591 driver implementation")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Stepan Ionichev <sozdayvek@xxxxxxxxx>
---
v2:
- Drop dev_err_probe(); just return ret (Andy)
- Add Cc: stable@ as suggested by Joshua

v1: https://lore.kernel.org/all/20260517181042.668-1-sozdayvek@xxxxxxxxx/

drivers/iio/light/tsl2591.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/light/tsl2591.c b/drivers/iio/light/tsl2591.c
index c5557867e..c5ccd833d 100644
--- a/drivers/iio/light/tsl2591.c
+++ b/drivers/iio/light/tsl2591.c
@@ -1137,10 +1137,8 @@ static int tsl2591_probe(struct i2c_client *client)
NULL, tsl2591_event_handler,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
"tsl2591_irq", indio_dev);
- if (ret) {
- dev_err_probe(&client->dev, ret, "IRQ request error\n");
- return -EINVAL;
- }
+ if (ret)
+ return ret;
indio_dev->info = &tsl2591_info;
} else {
indio_dev->info = &tsl2591_info_no_irq;
--
2.43.0