From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Frank Li <Frank.Li@nxp.com>
Cc: andriy.shevchenko@linux.intel.com,
heikki.krogerus@linux.intel.com, imx@lists.linux.dev,
jdelvare@suse.de, jic23@kernel.org, lars@metafoo.de,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
petrm@nvidia.com, pn@denx.de, u.kleine-koenig@pengutronix.de
Subject: Re: [PATCH 1/1] iio: light: vcnl4035: fixed chip ID check
Date: Sun, 30 Apr 2023 19:26:09 +0200 [thread overview]
Message-ID: <2d11fffd-efa5-9922-fd89-9e7246195f66@wanadoo.fr> (raw)
In-Reply-To: <20230427213038.1375404-1-Frank.Li@nxp.com>
Le 27/04/2023 à 23:30, Frank Li a écrit :
> VCNL4035 register(0xE) ID_L and ID_M define as:
>
> ID_L: 0x80
> ID_H: 7:6 (0:0)
> 5:4 (0:0) slave address = 0x60 (7-bit)
> (0:1) slave address = 0x51 (7-bit)
> (1:0) slave address = 0x40 (7-bit)
> (1:0) slave address = 0x41 (7-bit)
> 3:0 Version code default (0:0:0:0)
>
> So just check ID_L.
>
> Fixes: 55707294c4eb ("iio: light: Add support for vishay vcnl4035")
>
> Signed-off-by: Frank Li <Frank.Li-3arQi8VN3Tc@public.gmane.org>
> ---
> drivers/iio/light/vcnl4035.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/light/vcnl4035.c b/drivers/iio/light/vcnl4035.c
> index 3ed37f6057fb..8b7769930f3b 100644
> --- a/drivers/iio/light/vcnl4035.c
> +++ b/drivers/iio/light/vcnl4035.c
> @@ -413,7 +413,7 @@ static int vcnl4035_init(struct vcnl4035_data *data)
> return ret;
> }
>
> - if (id != VCNL4035_DEV_ID_VAL) {
> + if ((id & 0xff) != VCNL4035_DEV_ID_VAL) {
> dev_err(&data->client->dev, "Wrong id, got %x, expected %x\n",
> id, VCNL4035_DEV_ID_VAL);
Hi,
should the error message be updated as well?
Cj
> return -ENODEV;
prev parent reply other threads:[~2023-04-30 17:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-27 21:30 Frank Li
2023-04-30 17:22 ` Jonathan Cameron
2023-04-30 17:11 ` [EXT] " Frank Li
2023-04-30 17:26 ` Christophe JAILLET [this message]
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=2d11fffd-efa5-9922-fd89-9e7246195f66@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=Frank.Li@nxp.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=imx@lists.linux.dev \
--cc=jdelvare@suse.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=petrm@nvidia.com \
--cc=pn@denx.de \
--cc=u.kleine-koenig@pengutronix.de \
/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®