extcon: adc-jack: Fix platform_get_irq's error checking
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Thu, 23 Nov 2017 15:55:29 +0000 (21:25 +0530)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 27 Nov 2017 01:23:47 +0000 (10:23 +0900)
The platform_get_irq() function returns negative if an error occurs.
zero or positive number on success. platform_get_irq() error checking
for zero is not correct.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-adc-jack.c

index 3877d86c746a8ee2090463362d2eb9e7d08ec359..18026354c332cdc42f959ab2190516de019a35b3 100644 (file)
@@ -144,7 +144,7 @@ static int adc_jack_probe(struct platform_device *pdev)
                return err;
 
        data->irq = platform_get_irq(pdev, 0);
-       if (!data->irq) {
+       if (data->irq < 0) {
                dev_err(&pdev->dev, "platform_get_irq failed\n");
                return -ENODEV;
        }