diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2011-12-19 09:23:42 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-12-22 16:38:06 -0500 |
commit | d4a6882e1b9f01fa5bf7bb695081133121106dbb (patch) | |
tree | 422cf4e53f962c33438abadf0a60ef3ff56d2590 /drivers | |
parent | 0ae3a912d8beabb2fd9bf81054b88aa8dc40feb5 (diff) |
staging:iio: Use iio_buffer_enabled instead of open coding it
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/iio/industrialio-buffer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/iio/industrialio-buffer.c b/drivers/staging/iio/industrialio-buffer.c index 68db2d24c5e8..36993038b261 100644 --- a/drivers/staging/iio/industrialio-buffer.c +++ b/drivers/staging/iio/industrialio-buffer.c | |||
@@ -420,7 +420,7 @@ ssize_t iio_buffer_store_enable(struct device *dev, | |||
420 | mutex_lock(&indio_dev->mlock); | 420 | mutex_lock(&indio_dev->mlock); |
421 | previous_mode = indio_dev->currentmode; | 421 | previous_mode = indio_dev->currentmode; |
422 | requested_state = !(buf[0] == '0'); | 422 | requested_state = !(buf[0] == '0'); |
423 | current_state = !!(previous_mode & INDIO_ALL_BUFFER_MODES); | 423 | current_state = iio_buffer_enabled(indio_dev); |
424 | if (current_state == requested_state) { | 424 | if (current_state == requested_state) { |
425 | printk(KERN_INFO "iio-buffer, current state requested again\n"); | 425 | printk(KERN_INFO "iio-buffer, current state requested again\n"); |
426 | goto done; | 426 | goto done; |
@@ -509,8 +509,7 @@ ssize_t iio_buffer_show_enable(struct device *dev, | |||
509 | char *buf) | 509 | char *buf) |
510 | { | 510 | { |
511 | struct iio_dev *indio_dev = dev_get_drvdata(dev); | 511 | struct iio_dev *indio_dev = dev_get_drvdata(dev); |
512 | return sprintf(buf, "%d\n", !!(indio_dev->currentmode | 512 | return sprintf(buf, "%d\n", iio_buffer_enabled(indio_dev)); |
513 | & INDIO_ALL_BUFFER_MODES)); | ||
514 | } | 513 | } |
515 | EXPORT_SYMBOL(iio_buffer_show_enable); | 514 | EXPORT_SYMBOL(iio_buffer_show_enable); |
516 | 515 | ||