aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-trigger.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2012-05-12 09:39:33 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-14 16:37:45 -0400
commite53f5ac52ec19c8c606aeacdd13fed2a03d7365a (patch)
tree8463a43fb6121066350373dc9cc045afdf4c39d0 /drivers/iio/industrialio-trigger.c
parent7a7913f11ddf932e20d2bde72bec57f2f7a9b49e (diff)
iio: Use dev_to_iio_dev()
Replace open-coded instances of getting a iio_dev struct from a device struct with dev_to_iio_dev(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/iio/industrialio-trigger.c')
-rw-r--r--drivers/iio/industrialio-trigger.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
index 1dbd7b86a694..0f582df75a19 100644
--- a/drivers/iio/industrialio-trigger.c
+++ b/drivers/iio/industrialio-trigger.c
@@ -310,7 +310,7 @@ static ssize_t iio_trigger_read_current(struct device *dev,
310 struct device_attribute *attr, 310 struct device_attribute *attr,
311 char *buf) 311 char *buf)
312{ 312{
313 struct iio_dev *indio_dev = dev_get_drvdata(dev); 313 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
314 314
315 if (indio_dev->trig) 315 if (indio_dev->trig)
316 return sprintf(buf, "%s\n", indio_dev->trig->name); 316 return sprintf(buf, "%s\n", indio_dev->trig->name);
@@ -329,7 +329,7 @@ static ssize_t iio_trigger_write_current(struct device *dev,
329 const char *buf, 329 const char *buf,
330 size_t len) 330 size_t len)
331{ 331{
332 struct iio_dev *indio_dev = dev_get_drvdata(dev); 332 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
333 struct iio_trigger *oldtrig = indio_dev->trig; 333 struct iio_trigger *oldtrig = indio_dev->trig;
334 struct iio_trigger *trig; 334 struct iio_trigger *trig;
335 int ret; 335 int ret;