[PATCH] ata: pata_mpc52xx: convert to platform_get_irq()
From: Rosen Penev
Date: Wed Jun 03 2026 - 15:22:38 EST
Replace irq_of_parse_and_map() with platform_get_irq(), which returns
a negative errno on failure and integrates with the platform device
model. Since platform_get_irq() does not create a separately managed
mapping, the corresponding irq_dispose_mapping() calls in the probe
error path and remove function are no longer needed.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
drivers/ata/pata_mpc52xx.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c
index 210a63283f62..f8ecd58765dd 100644
--- a/drivers/ata/pata_mpc52xx.c
+++ b/drivers/ata/pata_mpc52xx.c
@@ -730,10 +730,10 @@ static int mpc52xx_ata_probe(struct platform_device *op)
if ((prop) && (proplen >= 4))
udma_mask = ATA_UDMA2 & ((1 << (*prop + 1)) - 1);
- ata_irq = irq_of_parse_and_map(op->dev.of_node, 0);
- if (!ata_irq) {
+ ata_irq = platform_get_irq(op, 0);
+ if (ata_irq < 0) {
dev_err(&op->dev, "error mapping irq\n");
- return -EINVAL;
+ return ata_irq;
}
/* Prepare our private structure */
@@ -796,7 +796,6 @@ static int mpc52xx_ata_probe(struct platform_device *op)
irq_dispose_mapping(task_irq);
bcom_ata_release(dmatsk);
err1:
- irq_dispose_mapping(ata_irq);
return rv;
}
@@ -813,7 +812,6 @@ static void mpc52xx_ata_remove(struct platform_device *op)
task_irq = bcom_get_task_irq(priv->dmatsk);
irq_dispose_mapping(task_irq);
bcom_ata_release(priv->dmatsk);
- irq_dispose_mapping(priv->ata_irq);
}
#ifdef CONFIG_PM_SLEEP
--
2.54.0