ata: sata_mv: Use platform_get_irq() to get interrupt

Extract platform_get_irq() out of the conditional block to run it
unconditionally, replacing the direct use of irq_of_parse_and_map()
for DT-based systems. This simplifies the probe logic and avoids the
need for irq_dispose_mapping.

Remove dead branch for platform_get_irq(). It intercepts 0 and returns
-EINVAL, which goes to the first one.

Assisted-by: Antigravity:Gemini-3.5-Flash
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
This commit is contained in:
Rosen Penev 2026-07-12 15:20:03 -07:00 committed by Damien Le Moal
parent 5aef4cb321
commit 692a964305

View File

@ -4054,17 +4054,13 @@ static int mv_platform_probe(struct platform_device *pdev)
n_ports);
return -EINVAL;
}
irq = irq_of_parse_and_map(pdev->dev.of_node, 0);
} else {
mv_platform_data = dev_get_platdata(&pdev->dev);
n_ports = mv_platform_data->n_ports;
irq = platform_get_irq(pdev, 0);
}
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
if (!irq)
return -EINVAL;
host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);