Skip to content

Commit c034640

Browse files
tpetazzonihtejun
authored andcommitted
ata: libahci: properly propagate return value of platform_get_irq()
When platform_get_irq() fails, it returns an error code, which libahci_platform and replaces it by -EINVAL. This commit fixes that by propagating the error code. It fixes the situation where platform_get_irq() returns -EPROBE_DEFER because the interrupt controller is not available yet, and generally looks like the right thing to do. We pay attention to not show the "no irq" message when we are in an EPROBE_DEFER situation, because the driver probing will be retried later on, once the interrupt controller becomes available to provide the interrupt. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>
1 parent 5dc63fd commit c034640

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/ata/libahci_platform.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,9 @@ int ahci_platform_init_host(struct platform_device *pdev,
514514

515515
irq = platform_get_irq(pdev, 0);
516516
if (irq <= 0) {
517-
dev_err(dev, "no irq\n");
518-
return -EINVAL;
517+
if (irq != -EPROBE_DEFER)
518+
dev_err(dev, "no irq\n");
519+
return irq;
519520
}
520521

521522
hpriv->irq = irq;

0 commit comments

Comments
 (0)