mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: accel: adxl367: resolve interrupt mapping before device setup
@ 2026-09-07  8:23 Antoniu Miclaus
  2026-09-07 14:56 ` Joshua Crofts
  0 siblings, 1 reply; 2+ messages in thread
From: Antoniu Miclaus @ 2026-09-07  8:23 UTC (permalink / raw)
  To: Marcelo Schmitt, Antoniu Miclaus, Nuno Sá,
	Michael Hennerich, Jonathan Cameron, David Lechner, linux-iio,
	linux, linux-kernel

adxl367_set_int_map_reg() uses fwnode_irq_get_byname(), which can return
-EPROBE_DEFER. Running it after adxl367_setup() made every deferred probe
repeat the reset and power the device up needlessly.

Move it ahead of the regulator enable and reset; the lookup only reads
firmware properties, so a deferral now returns before any hardware access.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/accel/adxl367.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/accel/adxl367.c b/drivers/iio/accel/adxl367.c
index 9b47e66c49ea..026db73057c5 100644
--- a/drivers/iio/accel/adxl367.c
+++ b/drivers/iio/accel/adxl367.c
@@ -1493,6 +1493,11 @@ int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
 	indio_dev->info = &adxl367_info;
 	indio_dev->modes = INDIO_DIRECT_MODE;
 
+	ret = adxl367_set_int_map_reg(st, irq);
+	if (ret < 0)
+		return dev_err_probe(st->dev, ret, "Failed to get interrupt\n");
+	irq = ret;
+
 	ret = devm_regulator_bulk_get_enable(st->dev,
 					     ARRAY_SIZE(regulator_names),
 					     regulator_names);
@@ -1520,11 +1525,6 @@ int adxl367_probe(struct device *dev, const struct adxl367_ops *ops,
 	if (ret)
 		return ret;
 
-	ret = adxl367_set_int_map_reg(st, irq);
-	if (ret < 0)
-		return dev_err_probe(st->dev, ret, "Failed to get interrupt\n");
-	irq = ret;
-
 	ret = devm_request_threaded_irq(st->dev, irq, NULL,
 					adxl367_irq_handler, IRQF_ONESHOT,
 					indio_dev->name, indio_dev);
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: accel: adxl367: resolve interrupt mapping before device setup
  2026-09-07  8:23 [PATCH] iio: accel: adxl367: resolve interrupt mapping before device setup Antoniu Miclaus
@ 2026-09-07 14:56 ` Joshua Crofts
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Crofts @ 2026-09-07 14:56 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: Marcelo Schmitt, Nuno Sá,
	Michael Hennerich, Jonathan Cameron, David Lechner, linux-iio,
	linux, linux-kernel

On Mon, 7 Sep 2026 11:23:13 +0300
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> adxl367_set_int_map_reg() uses fwnode_irq_get_byname(), which can return
> -EPROBE_DEFER. Running it after adxl367_setup() made every deferred probe
> repeat the reset and power the device up needlessly.
> 
> Move it ahead of the regulator enable and reset; the lookup only reads
> firmware properties, so a deferral now returns before any hardware access.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---

Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>

-- 
Kind regards,
Joshua Crofts

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-07 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-07  8:23 [PATCH] iio: accel: adxl367: resolve interrupt mapping before device setup Antoniu Miclaus
2026-09-07 14:56 ` Joshua Crofts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®