From 924f8a21dd13223cc1493a916c6769cf73e0d45e Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 26 Oct 2011 17:41:35 +0100 Subject: staging:iio: Do not use bitmasks for channel info addresses Currently the iio framework uses bitmasks for the address field of channel info attributes. This is for historical reasons and no longer required since it will only ever query a single info attribute at once. This patch changes the code to use the non-shifted iio_chan_info_enum values for the info attribute address. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/light/isl29018.c | 4 ++-- drivers/staging/iio/light/tsl2563.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging/iio/light') diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c index 9dc9e6358394..bed18a74d30c 100644 --- a/drivers/staging/iio/light/isl29018.c +++ b/drivers/staging/iio/light/isl29018.c @@ -362,7 +362,7 @@ static int isl29018_write_raw(struct iio_dev *indio_dev, int ret = -EINVAL; mutex_lock(&chip->lock); - if (mask == (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE) && + if (mask == IIO_CHAN_INFO_CALIBSCALE_SEPARATE && chan->type == IIO_LIGHT) { chip->lux_scale = val; ret = 0; @@ -402,7 +402,7 @@ static int isl29018_read_raw(struct iio_dev *indio_dev, if (!ret) ret = IIO_VAL_INT; break; - case (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE): + case IIO_CHAN_INFO_CALIBSCALE_SEPARATE: if (chan->type == IIO_LIGHT) { *val = chip->lux_scale; ret = IIO_VAL_INT; diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index 32dfce0a644f..45d04a1b1940 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c @@ -513,7 +513,7 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev, } break; - case (1 << IIO_CHAN_INFO_CALIBSCALE_SEPARATE): + case IIO_CHAN_INFO_CALIBSCALE_SEPARATE: if (chan->channel == 0) *val = calib_to_sysfs(chip->calib0); else -- cgit v1.2.3