Skip to content

Commit

Permalink
ata: libahci: properly propagate return value of platform_get_irq()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Petazzoni authored and Tejun Heo committed May 16, 2017
1 parent 5dc63fd commit c034640
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ata/libahci_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,9 @@ int ahci_platform_init_host(struct platform_device *pdev,

irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
dev_err(dev, "no irq\n");
return -EINVAL;
if (irq != -EPROBE_DEFER)
dev_err(dev, "no irq\n");
return irq;
}

hpriv->irq = irq;
Expand Down

0 comments on commit c034640

Please sign in to comment.