linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org, lars@metafoo.de, Michael.Hennerich@analog.com
Subject: Re: [PATCH 1/2] staging:iio: Make sure all triggers have a trigger_ops for the owner field.
Date: Sat, 10 Dec 2011 16:28:19 +0000	[thread overview]
Message-ID: <4EE388A3.8030208@kernel.org> (raw)
In-Reply-To: <1323531588-23293-2-git-send-email-jic23@kernel.org>

On 12/10/2011 03:39 PM, Jonathan Cameron wrote:
> The core needs the owner field to prevent module removal whilst in use and
> uses it without confirming that the trigger_ops structure actually exists.
> 
> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> ---
>  drivers/staging/iio/adc/ad7192.c |    6 +++++-
>  drivers/staging/iio/adc/ad7793.c |    5 +++++
>  2 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
> index 66cc507..6114601 100644
> --- a/drivers/staging/iio/adc/ad7192.c
> +++ b/drivers/staging/iio/adc/ad7192.c
> @@ -609,6 +609,10 @@ static irqreturn_t ad7192_data_rdy_trig_poll(int irq, void *private)
>  	return IRQ_HANDLED;
>  }
>  
> +static struct iio_trigger_ops ad7192_trigger_ops = {
> +	.owner = THIS_MODULE,
> +};
> +
>  static int ad7192_probe_trigger(struct iio_dev *indio_dev)
>  {
>  	struct ad7192_state *st = iio_priv(indio_dev);
> @@ -621,7 +625,7 @@ static int ad7192_probe_trigger(struct iio_dev *indio_dev)
>  		ret = -ENOMEM;
>  		goto error_ret;
>  	}
> -
> +	st->trig->ops = &ad7192_trigger_ops;
>  	ret = request_irq(st->spi->irq,
>  			  ad7192_data_rdy_trig_poll,
>  			  IRQF_TRIGGER_LOW,
> diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c
> index 4047c5d..f33feee 100644
> --- a/drivers/staging/iio/adc/ad7793.c
> +++ b/drivers/staging/iio/adc/ad7793.c
> @@ -475,6 +475,10 @@ static irqreturn_t ad7793_data_rdy_trig_poll(int irq, void *private)
>  	return IRQ_HANDLED;
>  }
>  
Lets just pretend for the point of view of review that this variable
actually had the appropriate name.  Sorry about that..
> +static struct iio_trigger_ops = {
> +	.owner = THIS_MODULE,
> +};
> +
>  static int ad7793_probe_trigger(struct iio_dev *indio_dev)
>  {
>  	struct ad7793_state *st = iio_priv(indio_dev);
> @@ -487,6 +491,7 @@ static int ad7793_probe_trigger(struct iio_dev *indio_dev)
>  		ret = -ENOMEM;
>  		goto error_ret;
>  	}
> +	st->trig->ops = &ad7793_trigger_ops;
>  
>  	ret = request_irq(st->spi->irq,
>  			  ad7793_data_rdy_trig_poll,


  reply	other threads:[~2011-12-10 16:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-10 15:39 [PATCH 0/2] staging:iio: trigger owner field confusion cleanup Jonathan Cameron
2011-12-10 15:39 ` [PATCH 1/2] staging:iio: Make sure all triggers have a trigger_ops for the owner field Jonathan Cameron
2011-12-10 16:28   ` Jonathan Cameron [this message]
2011-12-10 15:39 ` [PATCH 2/2] staging:iio: iio_trigger contains defunct owner field. Remove it Jonathan Cameron
2011-12-11 12:00 ` [PATCH 0/2] staging:iio: trigger owner field confusion cleanup Lars-Peter Clausen
  -- strict thread matches above, loose matches on Subject: below --
2011-12-14 20:49 Jonathan Cameron
2011-12-14 20:49 ` [PATCH 1/2] staging:iio: Make sure all triggers have a trigger_ops for the owner field 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=4EE388A3.8030208@kernel.org \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).