i2c: exynos5: fix platform_get_irq error handling
authorMartin Kaiser <martin@kaiser.cx>
Sun, 1 Nov 2020 17:18:06 +0000 (18:18 +0100)
committerWolfram Sang <wsa@kernel.org>
Tue, 3 Nov 2020 21:17:55 +0000 (22:17 +0100)
If platform_get_irq returns an error, relay this error to the caller of
the probe function. Don't change all errors to -EINVAL. This breaks the
case where platform_get_irq returns -EPROBE_DEFER.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-exynos5.c

index c5f5fb28762d8d3e7ca106cbfe56d355e78daba0..fad1c52857aa9c4309fff9a47c56a9678c3d7d71 100644 (file)
@@ -778,10 +778,8 @@ static int exynos5_i2c_probe(struct platform_device *pdev)
        init_completion(&i2c->msg_complete);
 
        i2c->irq = ret = platform_get_irq(pdev, 0);
-       if (ret <= 0) {
-               ret = -EINVAL;
+       if (ret <= 0)
                goto err_clk;
-       }
 
        ret = devm_request_irq(&pdev->dev, i2c->irq, exynos5_i2c_irq,
                               IRQF_NO_SUSPEND, dev_name(&pdev->dev), i2c);