From: Jonathan Cameron <jic23@kernel.org>
To: linux-iio@vger.kernel.org, greg@kroah.com
Cc: Jonathan Cameron <jic23@kernel.org>
Subject: [PATCH 1/2] staging:iio: Make sure all triggers have a trigger_ops for the owner field.
Date: Wed, 14 Dec 2011 20:49:30 +0000 [thread overview]
Message-ID: <1323895771-9940-2-git-send-email-jic23@kernel.org> (raw)
In-Reply-To: <1323895771-9940-1-git-send-email-jic23@kernel.org>
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>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
---
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..6e03bfb 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;
}
+static struct iio_trigger_ops ad7793_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,
--
1.7.7.4
next prev parent reply other threads:[~2011-12-14 20:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-14 20:49 [PATCH 0/2] staging:iio: trigger owner field confusion cleanup Jonathan Cameron
2011-12-14 20:49 ` Jonathan Cameron [this message]
2011-12-14 20:49 ` [PATCH 2/2] staging:iio: iio_trigger contains defunct owner field. Remove it Jonathan Cameron
-- strict thread matches above, loose matches on Subject: below --
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
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=1323895771-9940-2-git-send-email-jic23@kernel.org \
--to=jic23@kernel.org \
--cc=greg@kroah.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.