[PATCHv2 6/9] dmaengine: mv_xor: switch to of_irq_get()

From: Rosen Penev

Date: Thu Jun 11 2026 - 17:10:43 EST


Replace irq_of_parse_and_map() + irq_dispose_mapping() with of_irq_get(),
which maps the IRQ and registers a devres action to automatically dispose
the mapping on driver removal or probe failure. This allows dropping the
explicit irq_dispose_mapping() calls in the probe error path and remove
function.

Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
---
drivers/dma/mv_xor.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index d9403172ef59..eefc8f22bec6 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1423,9 +1423,9 @@ static int mv_xor_probe(struct platform_device *pdev)
dma_cap_set(DMA_XOR, cap_mask);
dma_cap_set(DMA_INTERRUPT, cap_mask);

- irq = irq_of_parse_and_map(np, 0);
- if (!irq) {
- ret = -ENODEV;
+ irq = of_irq_get(np, 0);
+ if (irq < 0) {
+ ret = irq;
goto err_channel_add;
}

@@ -1433,7 +1433,6 @@ static int mv_xor_probe(struct platform_device *pdev)
cap_mask, irq);
if (IS_ERR(chan)) {
ret = PTR_ERR(chan);
- irq_dispose_mapping(irq);
goto err_channel_add;
}

@@ -1468,11 +1467,8 @@ static int mv_xor_probe(struct platform_device *pdev)

err_channel_add:
for (i = 0; i < MV_XOR_MAX_CHANNELS; i++)
- if (xordev->channels[i]) {
+ if (xordev->channels[i])
mv_xor_channel_remove(xordev->channels[i]);
- if (pdev->dev.of_node)
- irq_dispose_mapping(xordev->channels[i]->irq);
- }

return ret;
}
--
2.54.0