mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: iio: light: isl29028: fix correct mask value
@ 2012-04-16 15:57 Laxman Dewangan
  2012-04-16 16:08 ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Laxman Dewangan @ 2012-04-16 15:57 UTC (permalink / raw)
  To: jic23, gregkh, linux-iio, devel, linux-kernel; +Cc: Laxman Dewangan

The mask value in the read_raw/write_raw is absolute
value, not the bit position value.
Fixing this in the implemented function to check value,
not with the bit position value.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
Somehow this was missed on my testing.
I tested today again with linux next and found this issue.

 drivers/staging/iio/light/isl29028.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
index e705e45..4e6ac24 100644
--- a/drivers/staging/iio/light/isl29028.c
+++ b/drivers/staging/iio/light/isl29028.c
@@ -272,7 +272,7 @@ static int isl29028_write_raw(struct iio_dev *indio_dev,
 	mutex_lock(&chip->lock);
 	switch (chan->type) {
 	case IIO_PROXIMITY:
-		if (mask != IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT) {
+		if (mask != IIO_CHAN_INFO_SAMP_FREQ) {
 			dev_err(chip->dev,
 				"proximity: mask value 0x%08lx not supported\n",
 				mask);
@@ -294,7 +294,7 @@ static int isl29028_write_raw(struct iio_dev *indio_dev,
 		break;
 
 	case IIO_LIGHT:
-		if (mask != IIO_CHAN_INFO_SCALE_SEPARATE_BIT) {
+		if (mask != IIO_CHAN_INFO_SCALE) {
 			dev_err(chip->dev,
 				"light: mask value 0x%08lx not supported\n",
 				mask);
@@ -349,14 +349,14 @@ static int isl29028_read_raw(struct iio_dev *indio_dev,
 		ret = IIO_VAL_INT;
 		break;
 
-	case IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT:
+	case IIO_CHAN_INFO_SAMP_FREQ:
 		if (chan->type != IIO_PROXIMITY)
 			break;
 		*val = chip->prox_sampling;
 		ret = IIO_VAL_INT;
 		break;
 
-	case IIO_CHAN_INFO_SCALE_SEPARATE_BIT:
+	case IIO_CHAN_INFO_SCALE:
 		if (chan->type != IIO_LIGHT)
 			break;
 		*val = chip->lux_scale;
-- 
1.7.1.1


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

end of thread, other threads:[~2012-04-18 23:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-16 15:57 [PATCH] staging: iio: light: isl29028: fix correct mask value Laxman Dewangan
2012-04-16 16:08 ` Jonathan Cameron
2012-04-18 23:32   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome