Linux EDAC development
 help / color / mirror / Atom feed
* [PATCH] EDAC/mpc85xx: Use platform_get_irq() to get interrupt
@ 2026-06-03 19:19 Rosen Penev
  2026-06-04  1:54 ` Borislav Petkov
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-06-03 19:19 UTC (permalink / raw)
  To: linux-edac; +Cc: Johannes Thumshirn, Borislav Petkov, Tony Luck, open list

Use platform_get_irq() to retrieve the interrupt resource instead of
directly parsing and mapping the OF node via irq_of_parse_and_map().
This is the standard pattern for platform devices.

In addition, platform_get_irq() returns a negative error code on
failure, which is now checked. Since we are no longer using
irq_of_parse_and_map(), we do not need to call irq_dispose_mapping()
on error or driver removal, so remove those calls.

Assisted-by: Antigravity:Gemini-3.5-Flash
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/edac/mpc85xx_edac.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 277f1c6bd522..f494d922c6a1 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -555,14 +555,17 @@ static int mpc85xx_l2_err_probe(struct platform_device *op)
 	}
 
 	if (edac_op_state == EDAC_OPSTATE_INT) {
-		pdata->irq = irq_of_parse_and_map(op->dev.of_node, 0);
+		pdata->irq = platform_get_irq(op, 0);
+		if (pdata->irq < 0) {
+			res = pdata->irq;
+			goto err;
+		}
 		res = devm_request_irq(&op->dev, pdata->irq,
 				       mpc85xx_l2_isr, IRQF_SHARED,
 				       "[EDAC] L2 err", edac_dev);
 		if (res < 0) {
 			pr_err("%s: Unable to request irq %d for MPC85xx L2 err\n",
 				__func__, pdata->irq);
-			irq_dispose_mapping(pdata->irq);
 			res = -ENODEV;
 			goto err2;
 		}
@@ -596,10 +599,8 @@ static void mpc85xx_l2_err_remove(struct platform_device *op)
 
 	edac_dbg(0, "\n");
 
-	if (edac_op_state == EDAC_OPSTATE_INT) {
+	if (edac_op_state == EDAC_OPSTATE_INT)
 		out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINTEN, 0);
-		irq_dispose_mapping(pdata->irq);
-	}
 
 	out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, orig_l2_err_disable);
 	edac_device_del_device(&op->dev);
-- 
2.54.0


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

* Re: [PATCH] EDAC/mpc85xx: Use platform_get_irq() to get interrupt
  2026-06-03 19:19 [PATCH] EDAC/mpc85xx: Use platform_get_irq() to get interrupt Rosen Penev
@ 2026-06-04  1:54 ` Borislav Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Borislav Petkov @ 2026-06-04  1:54 UTC (permalink / raw)
  To: Rosen Penev; +Cc: linux-edac, Johannes Thumshirn, Tony Luck, open list

On Wed, Jun 03, 2026 at 12:19:08PM -0700, Rosen Penev wrote:
> Use platform_get_irq() to retrieve the interrupt resource instead of
> directly parsing and mapping the OF node via irq_of_parse_and_map().
> This is the standard pattern for platform devices.
> 
> In addition, platform_get_irq() returns a negative error code on
> failure, which is now checked. Since we are no longer using
> irq_of_parse_and_map(), we do not need to call irq_dispose_mapping()
> on error or driver removal, so remove those calls.
> 
> Assisted-by: Antigravity:Gemini-3.5-Flash
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
>  drivers/edac/mpc85xx_edac.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)

I'd let Johannes comment here. AFAIR, he doesn't have the HW anymore and
I don't know who can test this for us so...

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2026-06-04  1:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03 19:19 [PATCH] EDAC/mpc85xx: Use platform_get_irq() to get interrupt Rosen Penev
2026-06-04  1:54 ` Borislav Petkov

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