lkml.org 
[lkml]   [2018]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] i2c: Add i2c_verify_device_id() to verify device id
On Sun, Apr 08, 2018 at 09:34:36AM +0200, Wolfram Sang wrote:
> Hi,
>
> On Mon, Mar 19, 2018 at 09:10:58AM -0700, Guenter Roeck wrote:
> > Commit dde67eb1beeb ("i2c: add i2c_get_device_id() to get the standard
> > I2C device id") added a function to return the standard I2C device ID.
> > Use that function to verify the device ID of a given device.
>
> I am very open to these patches, just...
>
> >
> > Cc: Peter Rosin <peda@axentia.se>
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> > RFC:
> > - Compile tested only
>
> ... I would really like to have them tested. After that happened, Peter
> and I can figure out who should apply them for seamless upstreaming.
>

Patch 2/2 was for real HW. I don't have access to such HW right now.
Guess we'll have to wait until someone does, unless Adrian is willing
to test it.

> > - Should there also be I2C_DEVICE_PART_ID_ANY to enable maching
> > against all parts from a given manufacturer ?
>
> Can't we just add it when we need it?
>
Perfectly fine with me.

> > + dev_err(&client->dev, "unexpected device id %03x-%03x-%x\n",
> > + real_id.manufacturer_id, real_id.part_id,
> > + real_id.die_revision);
> > + return -ENODEV;
>
> I wonder about the ERR loglevel. ENODEV is not an error, I'd think?
>
2d74187d5b4e, where this is derived from, uses dev_warn() instead,
so that may be a better choice.

Thanks,
Guenter

> Regards,
>
> Wolfram
>


\
 
 \ /
  Last update: 2018-04-09 20:30    [W:0.084 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site