Skip to content

Commit

Permalink
i2c: iop3xx: fix deferred probing
Browse files Browse the repository at this point in the history
[ Upstream commit a129950 ]

When adding the code to handle platform_get_irq*() errors in the commit
4894473 ("handle errors returned by platform_get_irq*()"), the
actual error code was enforced to be -ENXIO in the driver for some
strange reason.  This didn't matter much until the deferred probing was
introduced -- which requires an actual error code to be propagated
upstream from the failure site.

While fixing this, also stop overriding the errors from request_irq() to
-EIO (done since the pre-git era).

Fixes: 4894473 ("[PATCH] handle errors returned by platform_get_irq*()")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Sergey Shtylyov authored and gregkh committed Sep 15, 2021
1 parent 50e6f34 commit 3913fa3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/i2c/busses/i2c-iop3xx.c
Expand Up @@ -467,16 +467,14 @@ iop3xx_i2c_probe(struct platform_device *pdev)

irq = platform_get_irq(pdev, 0);
if (irq < 0) {
ret = -ENXIO;
ret = irq;
goto unmap;
}
ret = request_irq(irq, iop3xx_i2c_irq_handler, 0,
pdev->name, adapter_data);

if (ret) {
ret = -EIO;
if (ret)
goto unmap;
}

memcpy(new_adapter->name, pdev->name, strlen(pdev->name));
new_adapter->owner = THIS_MODULE;
Expand Down

0 comments on commit 3913fa3

Please sign in to comment.