summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-11-30 21:13:34 +0530
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2017-12-02 12:21:10 +0000
commitcccae604868c821754883edee6ced81b22e6b75a (patch)
treef0888afd28e36398995a596fd11693e47654fff4
parent798c3c9b4ccad00fe2639770c4c86d247b9ee846 (diff)
iio: trigger: 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: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/staging/iio/trigger/iio-trig-bfin-timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
index d80dcf82eba9..f389f5cca99d 100644
--- a/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
+++ b/drivers/staging/iio/trigger/iio-trig-bfin-timer.c
@@ -187,9 +187,9 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
return -ENOMEM;
st->irq = platform_get_irq(pdev, 0);
- if (!st->irq) {
+ if (st->irq < 0) {
dev_err(&pdev->dev, "No IRQs specified");
- return -ENODEV;
+ return st->irq;
}
ret = iio_bfin_tmr_get_number(st->irq);