sata_highbank: fix error return code in ahci_highbank_probe()
PATCH 1/1 sata_highbank: fix error return code in ahci_highbank_probe()
Propagate the return value of platform_get_irq on failure.
--- drivers/ata/sata_highbank.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ata/sata_highbank.c +2 -2
@@ -483,9 +483,9 @@ static int ahci_highbank_probe(struct platform_device *pdev) } irq =platform_get_irq (pdev,0 ); -if (irq <=0 ) { +if (irq <0 ) {dev_err (dev,"no irq\n" ); -return -EINVAL ; +return irq; } hpriv =devm_kzalloc (dev,sizeof (*hpriv),GFP_KERNEL );
Signature · 1 line
2.5.0
PATCH v2 1/1 sata_highbank: fix error return code in ahci_highbank_probe()
platform_get_irq() returns an error code, but the sata_highbank driver ignores it and always returns -EINVAL. This is not correct, and prevents -EPROBE_DEFER from being propagated properly. Also, notice that platform_get_irq() no longer returns 0 on error.
Print error message and propagate the return value of platform_get_irq on failure.
---
Changes in v2:
Rewrite commit message.
drivers/ata/sata_highbank.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/sata_highbank.c +3 -3
@@ -483,9 +483,9 @@ static int ahci_highbank_probe(struct platform_device *pdev) } irq =platform_get_irq (pdev,0 ); -if (irq <=0 ) { -dev_err (dev,"no irq\n" ); -return -EINVAL ; +if (irq <0 ) { +dev_err (dev,"failed to get IRQ: %d\n" , irq); +return irq; } hpriv =devm_kzalloc (dev,sizeof (*hpriv),GFP_KERNEL );
Signature · 1 line
2.5.0
Quoted 1 line · Gustavo A. R. Silva
Propagate the return value of
platform_get_irqon failure.
Needs the same explanations as the sata_rcar patch.
Quoted 1 line
Signed-off-by Gustavo A. R. Silva <[email protected]>
[...]
MBR, Sergei
Quoting Sergei Shtylyov <[email protected]>:
Quoted 6 lines · Gustavo A. R. Silva
Quoted 2 lines
Propagate the return value of
platform_get_irqon failure.Needs the same explanations as the
sata_rcarpatch.
Yep, I already sent v2 a minute ago.
Thanks!
--
Gustavo A. R. Silva