From 67464a54e5156ed2e5a72ffb516308b58f25e6ca Mon Sep 17 00:00:00 2001 From: Rodrigo Siqueira Date: Tue, 6 Mar 2018 09:02:57 -0300 Subject: iio: Replace occurrences of magic number 0 by IIO_CHAN_INFO_RAW Usually, functions responsible for reading raw data typically relies on values from iio_chan_info_enum to correctly identify the type of data to be read. There is a set of a device driver that uses the magic number 0 instead of IIO_CHAN_INFO_RAW. This patch improves the readability by replaces the magic number 0 for the appropriate IIO_CHAN_INFO_RAW in six devices driver in the IIO subsystem. Signed-off-by: Rodrigo Siqueira Signed-off-by: Jonathan Cameron --- drivers/iio/light/hid-sensor-als.c | 2 +- drivers/iio/light/lm3533-als.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/iio/light') diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c index befd693..406caae 100644 --- a/drivers/iio/light/hid-sensor-als.c +++ b/drivers/iio/light/hid-sensor-als.c @@ -97,7 +97,7 @@ static int als_read_raw(struct iio_dev *indio_dev, *val = 0; *val2 = 0; switch (mask) { - case 0: + case IIO_CHAN_INFO_RAW: switch (chan->scan_index) { case CHANNEL_SCAN_INDEX_INTENSITY: case CHANNEL_SCAN_INDEX_ILLUM: diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c index 36208a3..ff5a332 100644 --- a/drivers/iio/light/lm3533-als.c +++ b/drivers/iio/light/lm3533-als.c @@ -199,7 +199,7 @@ static int lm3533_als_read_raw(struct iio_dev *indio_dev, int ret; switch (mask) { - case 0: + case IIO_CHAN_INFO_RAW: switch (chan->type) { case IIO_LIGHT: ret = lm3533_als_get_adc(indio_dev, false, val); -- cgit v1.1