提交 c034640a 编写于 作者: T Thomas Petazzoni 提交者: Tejun Heo

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: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 5dc63fdc
...@@ -514,8 +514,9 @@ int ahci_platform_init_host(struct platform_device *pdev, ...@@ -514,8 +514,9 @@ int ahci_platform_init_host(struct platform_device *pdev,
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq <= 0) { if (irq <= 0) {
dev_err(dev, "no irq\n"); if (irq != -EPROBE_DEFER)
return -EINVAL; dev_err(dev, "no irq\n");
return irq;
} }
hpriv->irq = irq; hpriv->irq = irq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册