summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2014-08-07 13:06:00 +0200
committerJonathan Cameron <jic23@kernel.org>2014-07-08 22:14:41 +0200
commit8a32f65f389396267ae50a78d3416bcac5d4d959 (patch)
treeefe9d21cdc624e468e9eb23f4a63db27b52d6030 /drivers
parentstaging:iio:ad7291 cleanup defines (diff)
downloadlinux-8a32f65f389396267ae50a78d3416bcac5d4d959.tar.xz
linux-8a32f65f389396267ae50a78d3416bcac5d4d959.zip
staging:iio:ad7291 faciliate ad7291_read_event_config()
Save some lines in returning a voltage event. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/iio/adc/ad7291.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c
index 0ec6454b33a1..40f1cea25e1f 100644
--- a/drivers/staging/iio/adc/ad7291.c
+++ b/drivers/staging/iio/adc/ad7291.c
@@ -247,10 +247,7 @@ static int ad7291_read_event_config(struct iio_dev *indio_dev,
switch (chan->type) {
case IIO_VOLTAGE:
- if (chip->c_mask & BIT(15 - chan->channel))
- return 1;
- else
- return 0;
+ return !!(chip->c_mask & BIT(15 - chan->channel));
case IIO_TEMP:
/* always on */
return 1;