diff mbox

[2/2] spi: spi-imx: Propagate the real error code on platform_get_irq() failure

Message ID 1392347962-9835-2-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Commit 82106e0e39c455957888dd44d43790306b30f73e
Headers show

Commit Message

Fabio Estevam Feb. 14, 2014, 3:19 a.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.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/spi/spi-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Marek Vasut Feb. 14, 2014, 8:22 a.m. UTC | #1
On Friday, February 14, 2014 at 04:19:22 AM, Fabio Estevam wrote:
> 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.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Feb. 14, 2014, 8:41 p.m. UTC | #2
On Fri, Feb 14, 2014 at 01:19:22AM -0200, Fabio Estevam wrote:
> 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.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 2ccfde6..3577939 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -879,7 +879,7 @@  static int spi_imx_probe(struct platform_device *pdev)
 
 	spi_imx->irq = platform_get_irq(pdev, 0);
 	if (spi_imx->irq < 0) {
-		ret = -EINVAL;
+		ret = spi_imx->irq;
 		goto out_master_put;
 	}