* [PATCH] iio: accel: adxl380: fix check for unavailable "INT1" interrupt
@ 2025-11-26 14:46 Francesco Lavra
2025-11-26 18:13 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Francesco Lavra @ 2025-11-26 14:46 UTC (permalink / raw)
To: Ramona Gradinariu, Antoniu Miclaus, Lars-Peter Clausen,
Michael Hennerich, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel
fwnode_irq_get_byname() returns a negative value on failure.
Fixes: df36de13677a ("iio: accel: add ADXL380 driver")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
---
drivers/iio/accel/adxl380.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c
index 0cf3c6815829..b553e69347b8 100644
--- a/drivers/iio/accel/adxl380.c
+++ b/drivers/iio/accel/adxl380.c
@@ -1728,7 +1728,7 @@ static int adxl380_config_irq(struct iio_dev *indio_dev)
st->int_map[1] = ADXL380_INT0_MAP1_REG;
} else {
st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
- if (st->irq > 0)
+ if (st->irq < 0)
return dev_err_probe(st->dev, -ENODEV,
"no interrupt name specified");
st->int_map[0] = ADXL380_INT1_MAP0_REG;
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: accel: adxl380: fix check for unavailable "INT1" interrupt
2025-11-26 14:46 [PATCH] iio: accel: adxl380: fix check for unavailable "INT1" interrupt Francesco Lavra
@ 2025-11-26 18:13 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2025-11-26 18:13 UTC (permalink / raw)
To: Francesco Lavra
Cc: Ramona Gradinariu, Antoniu Miclaus, Lars-Peter Clausen,
Michael Hennerich, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, linux-iio, linux-kernel
On Wed, Nov 26, 2025 at 03:46:24PM +0100, Francesco Lavra wrote:
> fwnode_irq_get_byname() returns a negative value on failure.
...
> st->irq = fwnode_irq_get_byname(dev_fwnode(st->dev), "INT1");
> - if (st->irq > 0)
> + if (st->irq < 0)
> return dev_err_probe(st->dev, -ENODEV,
Please, also fix this.
> "no interrupt name specified");
Otherwise a good catch!
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-26 18:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26 14:46 [PATCH] iio: accel: adxl380: fix check for unavailable "INT1" interrupt Francesco Lavra
2025-11-26 18:13 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox