linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Tomas Novotny <tomas@novotny.cz>
Cc: linux-iio@vger.kernel.org, Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Subject: Re: [PATCH v2 3/4] iio: vcnl4000: warn on incorrectly specified device id
Date: Sat, 21 Jul 2018 18:07:37 +0100	[thread overview]
Message-ID: <20180721180737.68ea627d@archlinux> (raw)
In-Reply-To: <20180717164655.27142-4-tomas@novotny.cz>

On Tue, 17 Jul 2018 18:46:54 +0200
Tomas Novotny <tomas@novotny.cz> wrote:

> We can detect incorrectly specified device id for some chips, so warn
> user in that case.
> 
> Signed-off-by: Tomas Novotny <tomas@novotny.cz>
Ah, now the previous patch makes more sense.   Fair enough though
always remember reviewers tend to read one patch at a time, so making
it clear this was coming in the description for that one would have
been good.

Jonathan
> ---
>  drivers/iio/light/vcnl4000.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
> index 0688214fc152..642a366c1479 100644
> --- a/drivers/iio/light/vcnl4000.c
> +++ b/drivers/iio/light/vcnl4000.c
> @@ -83,8 +83,20 @@ static int vcnl4000_init(struct vcnl4000_data *data)
>  		return ret;
>  
>  	prod_id = ret >> 4;
> -	if (prod_id != VCNL4010_PROD_ID && prod_id != VCNL4000_PROD_ID)
> +	switch (prod_id) {
> +	case VCNL4000_PROD_ID:
> +		if (data->id != VCNL4000)
> +			dev_warn(&data->client->dev,
> +					"wrong device id, use vcnl4000");
> +		break;
> +	case VCNL4010_PROD_ID:
> +		if (data->id != VCNL4010)
> +			dev_warn(&data->client->dev,
> +					"wrong device id, use vcnl4010");
> +		break;
> +	default:
>  		return -ENODEV;
> +	}
>  
>  	data->rev = ret & 0xf;
>  	data->al_scale = 250000;


  reply	other threads:[~2018-07-21 18:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 16:46 [PATCH v2 0/4] iio: vcnl4000: add support for vcnl4200 Tomas Novotny
2018-07-17 16:46 ` [PATCH v2 1/4] iio: vcnl4000: make the driver extendable Tomas Novotny
2018-07-17 16:46 ` [PATCH v2 2/4] iio: vcnl4000: add VCNL4010 device id Tomas Novotny
2018-07-21 17:05   ` Jonathan Cameron
2018-07-23 16:57     ` Tomas Novotny
2018-07-17 16:46 ` [PATCH v2 3/4] iio: vcnl4000: warn on incorrectly specified " Tomas Novotny
2018-07-21 17:07   ` Jonathan Cameron [this message]
2018-07-17 16:46 ` [PATCH v2 4/4] iio: vcnl4000: add support for VCNL4200 Tomas Novotny
2018-07-21 17:20   ` Jonathan Cameron
2018-07-23 17:32     ` Tomas Novotny
2018-07-24 20:59       ` Jonathan Cameron
2018-07-21 17:25 ` [PATCH v2 0/4] iio: vcnl4000: add support for vcnl4200 Jonathan Cameron
2018-07-23 17:58   ` Tomas Novotny
2018-07-24 21:01     ` Jonathan Cameron
2018-07-25  9:12       ` Tomas Novotny

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=20180721180737.68ea627d@archlinux \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=tomas@novotny.cz \
    /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;
as well as URLs for NNTP newsgroup(s).