On Wed, Mar 26, 2003 at 10:42:23AM +0100, Jan Dittmer wrote: > Greg KH wrote: > As an example of the changes necessary, here's a patch against the i2c > >cvs version of the eeprom.c driver that converts it over to use sysfs, > >instead of the /proc and sysctl interface. It's still a bit rough, but > >you should get the idea of where I'm wanting to go with this. As you > >can see, it takes about 100 lines of code off of this driver, which is > >nice. > > > I thought about doing something like this for adding sysfs support. > Should the voltages and other data appear as integer or as floats in > sysfs tree? (ie. 1.20V or 120cV) floats are a pain! As we should have only one value per file, why not just "know" the units of the file, so that we don't have to mess with a decimal point. Makes the kernel a lot simpler and smaller, and then userspace can easily parse the number and do any needed conversions. > And what should be written back? I think the /proc interface expects > floats... Again, I would vote for simple integers. And good documentation about what each file's units are :) thanks, greg k-h