mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@cam.ac.uk>
To: Laxman Dewangan <ldewangan@nvidia.com>,
	gregkh@linuxfoundation.org, linux-iio@vger.kernel.org,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: iio: light: isl29028: fix correct mask value
Date: Mon, 16 Apr 2012 17:08:07 +0100	[thread overview]
Message-ID: <f9fb01a9-362a-4540-9547-63263a4ca10e@email.android.com> (raw)
In-Reply-To: <1334591862-5169-1-git-send-email-ldewangan@nvidia.com>



Laxman Dewangan <ldewangan@nvidia.com> wrote:

>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.
Oops I should have caught that.
Sorry 
>
>Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: <jic23@kernel.org>
>---
>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
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

  reply	other threads:[~2012-04-16 16:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 15:57 Laxman Dewangan
2012-04-16 16:08 ` Jonathan Cameron [this message]
2012-04-18 23:32   ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9fb01a9-362a-4540-9547-63263a4ca10e@email.android.com \
    --to=jic23@cam.ac.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ldewangan@nvidia.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®