diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-05-12 09:39:33 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-05-14 16:37:45 -0400 |
commit | e53f5ac52ec19c8c606aeacdd13fed2a03d7365a (patch) | |
tree | 8463a43fb6121066350373dc9cc045afdf4c39d0 /drivers/iio/industrialio-event.c | |
parent | 7a7913f11ddf932e20d2bde72bec57f2f7a9b49e (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-event.c')
-rw-r--r-- | drivers/iio/industrialio-event.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/industrialio-event.c b/drivers/iio/industrialio-event.c index 5fcf50b1ae5a..b49059de5d02 100644 --- a/drivers/iio/industrialio-event.c +++ b/drivers/iio/industrialio-event.c | |||
@@ -186,7 +186,7 @@ static ssize_t iio_ev_state_store(struct device *dev, | |||
186 | const char *buf, | 186 | const char *buf, |
187 | size_t len) | 187 | size_t len) |
188 | { | 188 | { |
189 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 189 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
190 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 190 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
191 | int ret; | 191 | int ret; |
192 | bool val; | 192 | bool val; |
@@ -205,7 +205,7 @@ static ssize_t iio_ev_state_show(struct device *dev, | |||
205 | struct device_attribute *attr, | 205 | struct device_attribute *attr, |
206 | char *buf) | 206 | char *buf) |
207 | { | 207 | { |
208 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 208 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
209 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 209 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
210 | int val = indio_dev->info->read_event_config(indio_dev, | 210 | int val = indio_dev->info->read_event_config(indio_dev, |
211 | this_attr->address); | 211 | this_attr->address); |
@@ -220,7 +220,7 @@ static ssize_t iio_ev_value_show(struct device *dev, | |||
220 | struct device_attribute *attr, | 220 | struct device_attribute *attr, |
221 | char *buf) | 221 | char *buf) |
222 | { | 222 | { |
223 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 223 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
224 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 224 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
225 | int val, ret; | 225 | int val, ret; |
226 | 226 | ||
@@ -237,7 +237,7 @@ static ssize_t iio_ev_value_store(struct device *dev, | |||
237 | const char *buf, | 237 | const char *buf, |
238 | size_t len) | 238 | size_t len) |
239 | { | 239 | { |
240 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 240 | struct iio_dev *indio_dev = dev_to_iio_dev(dev); |
241 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); | 241 | struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); |
242 | unsigned long val; | 242 | unsigned long val; |
243 | int ret; | 243 | int ret; |