[i2c] Empty i2c device name sysfs attribute

Jean Delvare khali at linux-fr.org
Sat Jun 23 11:58:12 CEST 2007


Hi David, hi Hans-Jürgen,

On Fri, 22 Jun 2007 22:41:10 +0200, Hans-Jürgen Koch wrote:
> Am Freitag 22 Juni 2007 21:54 schrieb David Brownell:
> > I'd rather just leave the empty file.   That distinguishes the
> > case of "no name provided" from "name is the same as the driver".
> 
> Good point.

Question is, do we really want to distinguish between both cases? The
former case seems quite useless to me, I can't think of a case where
the driver author would specifically want that over the latter. I
suspect that in most cases, driver authors will set the type string to
the same as the driver name string in the I2C device declaration
structure. It seems more efficient to me to do it just once in
i2c-core, rather than in all individual declarations.

> > And in any case, empty files are no problem.
> 
> All right. IMO an empty file is better than an "(unspecified)" string.
> Userspace software would have to check for that constant to find out
> if the string read from sysfs is a name or not. Ugly. It would
> subsequently mean that the string constant must always remain the same.

I wholeheartedly agree with this.

> > > If the driver doesn't specify a name, it means
> > > 1) that the driver name is the best you have to identify the device
> > > 2) that the driver's author is satisfied with this.
> > 
> > It means (2) only.  And of course, the driver name is
> > already available separately.
> 
> OK, you convinced me :-)

I'm not totally convinced yet, but I'm fine with leaving things as they
are for now. We'll see if driver authors complain.

-- 
Jean Delvare



More information about the i2c mailing list