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>
This commit is contained in:
committed by
Jonathan Cameron
parent
798c3c9b4c
commit
cccae60486
@@ -187,9 +187,9 @@ static int iio_bfin_tmr_trigger_probe(struct platform_device *pdev)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
st->irq = platform_get_irq(pdev, 0);
|
st->irq = platform_get_irq(pdev, 0);
|
||||||
if (!st->irq) {
|
if (st->irq < 0) {
|
||||||
dev_err(&pdev->dev, "No IRQs specified");
|
dev_err(&pdev->dev, "No IRQs specified");
|
||||||
return -ENODEV;
|
return st->irq;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = iio_bfin_tmr_get_number(st->irq);
|
ret = iio_bfin_tmr_get_number(st->irq);
|
||||||
|
Reference in New Issue
Block a user