public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Kelly <mkelly@xevo.com>
To: Mathieu Othacehe <m.othacehe@gmail.com>,
	"jic23@kernel.org" <jic23@kernel.org>,
	"knaack.h@gmx.de" <knaack.h@gmx.de>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"pmeerw@pmeerw.net" <pmeerw@pmeerw.net>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: trigger: Print an error if there is no available irq
Date: Wed, 13 Feb 2019 22:19:16 +0000	[thread overview]
Message-ID: <cd3cf791-e035-d06c-ea1b-4415a93ea7a2@xevo.com> (raw)
In-Reply-To: <20190213131752.646-1-m.othacehe@gmail.com>

On 2/13/19 5:17 AM, Mathieu Othacehe wrote:
> 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>
> ---
>   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,
> 

This seems useful! I think it would be good to print the value of 
CONFIG_IIO_CONSUMERS_PER_TRIGGER too. Also, it appears this is 
triggering a checkpatch warning:

WARNING: quoted string split across lines

  reply	other threads:[~2019-02-13 22:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-13 13:17 [PATCH] iio: trigger: Print an error if there is no available irq Mathieu Othacehe
2019-02-13 22:19 ` Martin Kelly [this message]
2019-02-20 11:34   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd3cf791-e035-d06c-ea1b-4415a93ea7a2@xevo.com \
    --to=mkelly@xevo.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.othacehe@gmail.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox