linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 5/6] staging:iio:ad7291 faciliate ad7291_read_event_config()
@ 2014-07-08 11:06 Hartmut Knaack
  2014-07-08 20:14 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Hartmut Knaack @ 2014-07-08 11:06 UTC (permalink / raw)
  To: linux-iio; +Cc: Jonathan Cameron, Lars-Peter Clausen

Save some lines in returning a voltage event.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
---
diff --git a/drivers/staging/iio/adc/ad7291.c b/drivers/staging/iio/adc/ad7291.c
index 654b39e..06eb0c0 100644
--- a/drivers/staging/iio/adc/ad7291.c
+++ b/drivers/staging/iio/adc/ad7291.c
@@ -242,10 +242,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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-08 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 11:06 [PATCH 5/6] staging:iio:ad7291 faciliate ad7291_read_event_config() Hartmut Knaack
2014-07-08 20:14 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).