]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iio: trigger: Print an error if there is no available irq
authorMathieu Othacehe <m.othacehe@gmail.com>
Wed, 20 Feb 2019 16:49:10 +0000 (17:49 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 4 Apr 2019 19:19:41 +0000 (20:19 +0100)
If there are more trigger consumers than
CONFIG_IIO_CONSUMERS_PER_TRIGGER, iio_trigger_attach_poll_func will
silently fail. Add an error message to inform the user that
CONFIG_IIO_CONSUMERS_PER_TRIGGER limit might be exceeded.

Signed-off-by: Mathieu Othacehe <m.othacehe@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-trigger.c

index ce66699c7fccb2b8824fa446a462b7d18e6865c5..e5b538379ed1fb1d2268585bac6c478f53cb23f2 100644 (file)
@@ -254,8 +254,11 @@ static int iio_trigger_attach_poll_func(struct iio_trigger *trig,
 
        /* Get irq number */
        pf->irq = iio_trigger_get_irq(trig);
-       if (pf->irq < 0)
+       if (pf->irq < 0) {
+               pr_err("Could not find an available irq for trigger %s, CONFIG_IIO_CONSUMERS_PER_TRIGGER=%d limit might be exceeded\n",
+                       trig->name, CONFIG_IIO_CONSUMERS_PER_TRIGGER);
                goto out_put_module;
+       }
 
        /* Request irq */
        ret = request_threaded_irq(pf->irq, pf->h, pf->thread,