Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: adc-jack: Fix platform_get_irq's error checking

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>

authored by

Arvind Yadav and committed by
Chanwoo Choi
447641eb 00c2f524

+1 -1
+1 -1
drivers/extcon/extcon-adc-jack.c
··· 144 144 return err; 145 145 146 146 data->irq = platform_get_irq(pdev, 0); 147 - if (!data->irq) { 147 + if (data->irq < 0) { 148 148 dev_err(&pdev->dev, "platform_get_irq failed\n"); 149 149 return -ENODEV; 150 150 }