[i2c] [PATCH 5/6] i2c: i2c_adapter drivers need no driver
Jean Delvare
khali at linux-fr.org
Fri Feb 16 07:49:43 CET 2007
Hi David,
On Thu, 15 Feb 2007 12:24:19 -0800, David Brownell wrote:
> On Thursday 15 February 2007 5:26 am, Jean Delvare wrote:
>
> > This patch appears to have a nasty side effect on log messages. When
> > using dev_info and friends on i2c-adapter (virtual) devices, the
> > message prefix is something like:
> > i2c-1: adapter [Parallel port adapter] registered
> > While it should be:
> > i2c_adapter i2c-1: adapter [Parallel port adapter] registered
> >
> > The driver name is missing, of course, as there no longer is a driver.
>
> This would not be the case if the code used
>
> dev_info(adapter->dev.parent, "...\n");
>
> instead of
>
> dev_info(&adapter->dev, "...\n")
>
> Plus, the named driver and device would make more sense: they'd match
> the actual hardware, not some pseudo-device ("i2c-1" etc). When there's
> a real hardware device and driver to associate with an event, it seems
> to me very wrong to couple messages to a pseudo-device.
Good point. However, this only works (properly) if the i2c adapter
pseudo-device actually has a parent, which you know isn't always the
case at the moment.
> The previous patches used adapter->cdev.dev, same positive result: the
> messages weren't coupled to a pseudo-device.
Agree, this makes sense. Greg, can you confirm this is the right thing
to do? But this also means we'll have to update (almost) all the i2c
bus drivers again :( I secretly hopped that with Greg's plan we
wouldn't have to.
I'll go through your original patches today and port them to do what
you suggest above. Let's see what we get.
--
Jean Delvare
More information about the i2c
mailing list