Skip to content

Commit

Permalink
extcon: adc-jack: Fix platform_get_irq's error checking
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Chanwoo Choi <[email protected]>
  • Loading branch information
ArvindYadavCs authored and chanwoochoi committed Nov 27, 2017
1 parent 00c2f52 commit 447641e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/extcon/extcon-adc-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 447641e

Please sign in to comment.