[i2c] [patch 2.6.19-rc6 3/11] i2c adapters don't use i2c_adapter.dev
David Brownell
david-b at pacbell.net
Sat Dec 16 02:53:29 CET 2006
On Friday 15 December 2006 9:16 am, Jean Delvare wrote:
> > --- g26.orig/drivers/i2c/busses/i2c-nforce2.c 2006-11-25 14:10:39.000000000 -0800
> > +++ g26/drivers/i2c/busses/i2c-nforce2.c 2006-11-25 14:24:50.000000000 -0800
>
> Note that the i2c-nforce2 driver was updated in 2.6.20-rc1 so this part
> of the patch needs to be updated.
Already got that ...
> > snprintf(smbus->adapter.name, I2C_NAME_SIZE,
> > - "SMBus nForce2 adapter at %04x", smbus->base);
> > + "SMBus nForce2 adapter %s at %04x", name, smbus->base);
>
> I can't see how this patch fits in this patchset. And there are
> user-space tools out there which rely on the adapter name strings, so
> we are not going to change them without a very good reason.
If you say so. The "smbus->base" strings should probably be removed
as useless then, since the only place they show up is with error
diagnostics. Me, I'd rather see the names emitted by Linux matching
the names from the chip manufacturer, which seems to mean using those
strings (and right there seems to be the best place).
> > - dev_info(&smbus->adapter.dev, "nForce2 SMBus adapter at %#x\n", smbus->base);
> > + dev_info(&dev->dev, "%s - %s\n", smbus->adapter.class_dev.class_id,
> > + smbus->adapter.name);
>
> I'm a bit curious about this change too. What's the idea?
Two things: (a) show the number from the class ID, to help make later
diagnostics more useful, and (b) shrink the number of data bytes in
the driver, since the information in the two strings is identical.
> > - dev_dbg(&adap->dev, "SMB_CNT after clock restore 0x%02x\n", sis630_read(SMB_CNT));
> > + dev_dbg(adap->class_dev.dev, "SMB_CNT after clock restore 0x%02x\n", sis630_read(SMB_CNT));
>
> Wrap. Each time it's needed, in fact.
OK, I did that to all these drivers: if those lines exceeded 80 chars, they
don't any more. In many cases they _started_ as overlong lines ... I agree,
this sort of cleanup should be done while those lines are changing anyway.
There were quite a lot of those...
> There are 3 new i2c bus drivers in 2.6.20-rc1: i2c-versatile, i2c-pnx
> and i2c-at91. The latter two would need to be added to this patch. The
> three of them need to be added to the core patch (for the dev.parent
> change.)
Right.
More information about the i2c
mailing list