Browse Source

iio: dummy_evgen: modify the return value check for irq_sim_init()

As discussed with Marc Zyngier: irq_sim_init() and its devres variant
should return the base of the allocated interrupt range on success
rather than 0. This will be modified later - first, change the way
users handle the return value of these routines.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bartosz Golaszewski 7 years ago
parent
commit
1b39eacdbd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/iio/dummy/iio_dummy_evgen.c

+ 1 - 1
drivers/iio/dummy/iio_dummy_evgen.c

@@ -56,7 +56,7 @@ static int iio_dummy_evgen_create(void)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	ret = irq_sim_init(&iio_evgen->irq_sim, IIO_EVENTGEN_NO);
 	ret = irq_sim_init(&iio_evgen->irq_sim, IIO_EVENTGEN_NO);
-	if (ret) {
+	if (ret < 0) {
 		kfree(iio_evgen);
 		kfree(iio_evgen);
 		return ret;
 		return ret;
 	}
 	}