aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-buffer.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-buffer.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-buffer.c')
-rw-r--r--drivers/iio/industrialio-buffer.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index b5b2c38045c5..ac185b8694bd 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -105,7 +105,7 @@ static ssize_t iio_scan_el_show(struct device *dev,
105 char *buf) 105 char *buf)
106{ 106{
107 int ret; 107 int ret;
108 struct iio_dev *indio_dev = dev_get_drvdata(dev); 108 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
109 109
110 ret = test_bit(to_iio_dev_attr(attr)->address, 110 ret = test_bit(to_iio_dev_attr(attr)->address,
111 indio_dev->buffer->scan_mask); 111 indio_dev->buffer->scan_mask);
@@ -126,7 +126,7 @@ static ssize_t iio_scan_el_store(struct device *dev,
126{ 126{
127 int ret; 127 int ret;
128 bool state; 128 bool state;
129 struct iio_dev *indio_dev = dev_get_drvdata(dev); 129 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
130 struct iio_buffer *buffer = indio_dev->buffer; 130 struct iio_buffer *buffer = indio_dev->buffer;
131 struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); 131 struct iio_dev_attr *this_attr = to_iio_dev_attr(attr);
132 132
@@ -162,7 +162,7 @@ static ssize_t iio_scan_el_ts_show(struct device *dev,
162 struct device_attribute *attr, 162 struct device_attribute *attr,
163 char *buf) 163 char *buf)
164{ 164{
165 struct iio_dev *indio_dev = dev_get_drvdata(dev); 165 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
166 return sprintf(buf, "%d\n", indio_dev->buffer->scan_timestamp); 166 return sprintf(buf, "%d\n", indio_dev->buffer->scan_timestamp);
167} 167}
168 168
@@ -172,7 +172,7 @@ static ssize_t iio_scan_el_ts_store(struct device *dev,
172 size_t len) 172 size_t len)
173{ 173{
174 int ret; 174 int ret;
175 struct iio_dev *indio_dev = dev_get_drvdata(dev); 175 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
176 bool state; 176 bool state;
177 177
178 ret = strtobool(buf, &state); 178 ret = strtobool(buf, &state);
@@ -352,7 +352,7 @@ ssize_t iio_buffer_read_length(struct device *dev,
352 struct device_attribute *attr, 352 struct device_attribute *attr,
353 char *buf) 353 char *buf)
354{ 354{
355 struct iio_dev *indio_dev = dev_get_drvdata(dev); 355 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
356 struct iio_buffer *buffer = indio_dev->buffer; 356 struct iio_buffer *buffer = indio_dev->buffer;
357 357
358 if (buffer->access->get_length) 358 if (buffer->access->get_length)
@@ -370,7 +370,7 @@ ssize_t iio_buffer_write_length(struct device *dev,
370{ 370{
371 int ret; 371 int ret;
372 ulong val; 372 ulong val;
373 struct iio_dev *indio_dev = dev_get_drvdata(dev); 373 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
374 struct iio_buffer *buffer = indio_dev->buffer; 374 struct iio_buffer *buffer = indio_dev->buffer;
375 375
376 ret = strict_strtoul(buf, 10, &val); 376 ret = strict_strtoul(buf, 10, &val);
@@ -403,7 +403,7 @@ ssize_t iio_buffer_store_enable(struct device *dev,
403 int ret; 403 int ret;
404 bool requested_state, current_state; 404 bool requested_state, current_state;
405 int previous_mode; 405 int previous_mode;
406 struct iio_dev *indio_dev = dev_get_drvdata(dev); 406 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
407 struct iio_buffer *buffer = indio_dev->buffer; 407 struct iio_buffer *buffer = indio_dev->buffer;
408 408
409 mutex_lock(&indio_dev->mlock); 409 mutex_lock(&indio_dev->mlock);
@@ -489,7 +489,7 @@ ssize_t iio_buffer_show_enable(struct device *dev,
489 struct device_attribute *attr, 489 struct device_attribute *attr,
490 char *buf) 490 char *buf)
491{ 491{
492 struct iio_dev *indio_dev = dev_get_drvdata(dev); 492 struct iio_dev *indio_dev = dev_to_iio_dev(dev);
493 return sprintf(buf, "%d\n", iio_buffer_enabled(indio_dev)); 493 return sprintf(buf, "%d\n", iio_buffer_enabled(indio_dev));
494} 494}
495EXPORT_SYMBOL(iio_buffer_show_enable); 495EXPORT_SYMBOL(iio_buffer_show_enable);