Re: [PATCH 5/6] staging:iio:ad7291 faciliate ad7291_read_event_config()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/07/14 12:06, Hartmut Knaack wrote:
Save some lines in returning a voltage event.

Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx>
Applied to the togreg branch of iio.git

Thanks
---
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;
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux