diff mbox

[v2,2/2] pata_imx: Propagate the real error code on platform_get_irq() failure

Message ID 1392674757-1788-2-git-send-email-festevam@gmail.com
State Not Applicable
Delegated to: David Miller
Headers show

Commit Message

Fabio Estevam Feb. 17, 2014, 10:05 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

No need to return a 'fake' return value on platform_get_irq() failure.

Just return the error code itself instead.

Also, change the error condition to irq < 0, so that only negative values
are treated as errors.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Only return error on negative values

 drivers/ata/pata_imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/ata/pata_imx.c b/drivers/ata/pata_imx.c
index 3668e78..fa8e69c 100644
--- a/drivers/ata/pata_imx.c
+++ b/drivers/ata/pata_imx.c
@@ -100,8 +100,8 @@  static int pata_imx_probe(struct platform_device *pdev)
 	int ret;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
-		return -EINVAL;
+	if (irq < 0)
+		return irq;
 
 	priv = devm_kzalloc(&pdev->dev,
 				sizeof(struct pata_imx_priv), GFP_KERNEL);