The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] ata: pata_mpc52xx: convert to platform_get_irq()
@ 2026-06-03 19:20 Rosen Penev
  2026-06-03 19:38 ` Sergey Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Rosen Penev @ 2026-06-03 19:20 UTC (permalink / raw)
  To: linux-ide; +Cc: Damien Le Moal, Niklas Cassel, open list

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@gmail.com>
---
 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


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

* Re: [PATCH] ata: pata_mpc52xx: convert to platform_get_irq()
  2026-06-03 19:20 [PATCH] ata: pata_mpc52xx: convert to platform_get_irq() Rosen Penev
@ 2026-06-03 19:38 ` Sergey Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Shtylyov @ 2026-06-03 19:38 UTC (permalink / raw)
  To: Rosen Penev, linux-ide; +Cc: Damien Le Moal, Niklas Cassel, open list

On 6/3/26 10:20 PM, Rosen Penev wrote:

> 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@gmail.com>
> ---
>  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");

   s/mapping/getting/?
   But actually platform_get_irq() loudly curses on error already... :-)

[...]

MBR, Sergey


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

end of thread, other threads:[~2026-06-03 19:38 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:20 [PATCH] ata: pata_mpc52xx: convert to platform_get_irq() Rosen Penev
2026-06-03 19:38 ` Sergey Shtylyov

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