[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190213131752.646-1-m.othacehe@gmail.com>
Date: Wed, 13 Feb 2019 14:17:52 +0100
From: Mathieu Othacehe <m.othacehe@...il.com>
To: jic23@...nel.org, knaack.h@....de, lars@...afoo.de,
pmeerw@...erw.net
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
Mathieu Othacehe <m.othacehe@...il.com>
Subject: [PATCH] iio: trigger: Print an error if there is no available irq
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@...il.com>
---
drivers/iio/industrialio-trigger.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index ce66699c7fcc..801986c21467 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -254,8 +254,12 @@ 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 limit "
+ "might be exceeded\n", trig->name);
goto out_put_module;
+ }
/* Request irq */
ret = request_threaded_irq(pf->irq, pf->h, pf->thread,
--
2.17.1
Powered by blists - more mailing lists