Patchwork i2c: imx: propagate irq error code in probe

login
register
mail settings
Submitter Wolfram Sang
Date Dec. 12, 2013, 9:51 p.m.
Message ID <1386885091-23188-1-git-send-email-wsa@the-dreams.de>
Download mbox | patch
Permalink /patch/300774/
State Accepted
Headers show

Comments

Wolfram Sang - Dec. 12, 2013, 9:51 p.m.
smatch rightfully says:
drivers/i2c/busses/i2c-imx.c:610 i2c_imx_probe() info: why not propagate 'irq' from platform_get_irq() instead of (-2)?

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/i2c/busses/i2c-imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Wolfram Sang - Jan. 3, 2014, 4:38 p.m.
On Thu, Dec 12, 2013 at 10:51:31PM +0100, Wolfram Sang wrote:
> smatch rightfully says:
> drivers/i2c/busses/i2c-imx.c:610 i2c_imx_probe() info: why not propagate 'irq' from platform_get_irq() instead of (-2)?
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

Applied to for-next, thanks!

Patch

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index d0cfbb4..db895fb 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -607,7 +607,7 @@  static int i2c_imx_probe(struct platform_device *pdev)
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0) {
 		dev_err(&pdev->dev, "can't get irq number\n");
-		return -ENOENT;
+		return irq;
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);