From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Philippe Reynes <tremyfr@yahoo.fr>,
Martin Fuzzey <mfuzzey@parkeon.com>,
linux-iio@vger.kernel.org, Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH v3 3/4] iio:max1027: Use iio_trigger_validate_own_device() helper
Date: Fri, 23 Sep 2016 17:19:43 +0200 [thread overview]
Message-ID: <1474643984-14262-3-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1474643984-14262-1-git-send-email-lars@metafoo.de>
Use the new iio_trigger_validate_own_device() to verify that the trigger
can only be attached to the matching IIO device rather than using a custom
variant.
While the implementation of iio_trigger_validate_own_device() and the
custom variant and are not identical their behaviour is.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
New in v3
---
drivers/iio/adc/max1027.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index 712fbd2..8ea3271 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -360,17 +360,6 @@ static int max1027_set_trigger_state(struct iio_trigger *trig, bool state)
return 0;
}
-static int max1027_validate_device(struct iio_trigger *trig,
- struct iio_dev *indio_dev)
-{
- struct iio_dev *indio = iio_trigger_get_drvdata(trig);
-
- if (indio != indio_dev)
- return -EINVAL;
-
- return 0;
-}
-
static irqreturn_t max1027_trigger_handler(int irq, void *private)
{
struct iio_poll_func *pf = (struct iio_poll_func *)private;
@@ -391,7 +380,7 @@ static irqreturn_t max1027_trigger_handler(int irq, void *private)
static const struct iio_trigger_ops max1027_trigger_ops = {
.owner = THIS_MODULE,
- .validate_device = &max1027_validate_device,
+ .validate_device = &iio_trigger_validate_own_device,
.set_trigger_state = &max1027_set_trigger_state,
};
--
2.1.4
next prev parent reply other threads:[~2016-09-23 15:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-23 15:19 [PATCH v3 1/4] iio:trigger: Add helper function to verify that a trigger belongs to the same device Lars-Peter Clausen
2016-09-23 15:19 ` [PATCH v3 2/4] iio:mma8452: Use new iio_trigger_validate_own_device() helper Lars-Peter Clausen
2016-09-24 16:25 ` Jonathan Cameron
2016-09-23 15:19 ` Lars-Peter Clausen [this message]
2016-09-24 16:27 ` [PATCH v3 3/4] iio:max1027: Use " Jonathan Cameron
2016-09-23 15:19 ` [PATCH v3 4/4] iio:adc: Add support for AD7766/AD7767 Lars-Peter Clausen
2016-09-24 16:32 ` Jonathan Cameron
2016-09-24 16:33 ` Jonathan Cameron
2016-09-24 16:21 ` [PATCH v3 1/4] iio:trigger: Add helper function to verify that a trigger belongs to the same device 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=1474643984-14262-3-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=linux-iio@vger.kernel.org \
--cc=mfuzzey@parkeon.com \
--cc=pmeerw@pmeerw.net \
--cc=tremyfr@yahoo.fr \
/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).