Skip to content

Commit cbffe6b

Browse files
mudongliangwsakernel
authored andcommitted
i2c: davinci: remove dead code in probe
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>
1 parent ff0cf7b commit cbffe6b

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/i2c/busses/i2c-davinci.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,8 @@ static int davinci_i2c_probe(struct platform_device *pdev)
764764
int r, irq;
765765

766766
irq = platform_get_irq(pdev, 0);
767-
if (irq <= 0) {
768-
if (!irq)
769-
irq = -ENXIO;
767+
if (irq < 0)
770768
return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
771-
}
772769

773770
dev = devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev),
774771
GFP_KERNEL);

0 commit comments

Comments
 (0)