mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 03:10:12 +00:00
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:
parent
798c3c9b4c
commit
cccae60486
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue