LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: cpm: Use platform_get_irq() to retrieve interrupt
@ 2026-06-03  0:54 Rosen Penev
  2026-06-03  8:15 ` Christophe Leroy (CS GROUP)
  0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2026-06-03  0:54 UTC (permalink / raw)
  To: linux-i2c
  Cc: Jochen Friedrich, Andi Shyti, open list:FREESCALE I2C CPM DRIVER,
	open list

Replace irq_of_parse_and_map() with platform_get_irq() as recommended
for device-managed IRQ lookup. Properly propagate any errors returned
from platform_get_irq(). irq_of_parse_and_map() requires
ire_dispose_mapping(), which is missing.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/i2c/busses/i2c-cpm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 2cb6a233d313..23679c192edc 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -434,9 +434,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
 
 	init_waitqueue_head(&cpm->i2c_wait);
 
-	cpm->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);
-	if (!cpm->irq)
-		return -EINVAL;
+	cpm->irq = platform_get_irq(ofdev, 0);
+	if (cpm->irq < 0)
+		return cpm->irq;
 
 	/* Install interrupt handler. */
 	ret = request_irq(cpm->irq, cpm_i2c_interrupt, 0, "cpm_i2c",
-- 
2.54.0



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

end of thread, other threads:[~2026-06-03  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03  0:54 [PATCH] i2c: cpm: Use platform_get_irq() to retrieve interrupt Rosen Penev
2026-06-03  8:15 ` Christophe Leroy (CS GROUP)
2026-06-03  9:38   ` Rosen Penev

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