]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i2c: davinci: remove dead code in probe
authorDongliang Mu <dzm91@hust.edu.cn>
Mon, 6 Mar 2023 02:45:23 +0000 (10:45 +0800)
committerWolfram Sang <wsa@kernel.org>
Thu, 16 Mar 2023 19:51:02 +0000 (20:51 +0100)
From the comment of platform_get_irq, it only returns non-zero IRQ
number and negative error number, other than zero.

Fix this by removing the if condition.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-davinci.c

index c836cf8841850ac10d167c7c941f06b438c7c07d..9750310f2c961180f6d8e7e7a84801eedc768c75 100644 (file)
@@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
        int r, irq;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0) {
-               if (!irq)
-                       irq = -ENXIO;
+       if (irq < 0)
                return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
-       }
 
        dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
                        GFP_KERNEL);