Hi, On Thu, Jan 23, 2014 at 11:16:01AM -0800, Curt Brune wrote: > Create a new hardware class under /sys/class/eeprom_dev > > EEPROM drivers can register their devices with the eeprom_dev class > during instantiation. > > The registered devices show up as: > > /sys/class/eeprom_dev/eeprom0 > /sys/class/eeprom_dev/eeprom1 > ... > /sys/class/eeprom_dev/eeprom[N] > > Each member of the eeprom class exports a sysfs file called "label", > containing the label property from the corresponding device tree node. > > Example: > > /sys/class/eeprom_dev/eeprom0/label > > If the device tree node property "label" does not exist the value > "unknown" is used. > > Note: The class cannot be called 'eeprom' as that is the name of the > I/O file created by the driver. The class name appears as a > sub-directory within the main device directory. Hence the class name > 'eeprom_dev'. > > Userspace can use the label to identify what the EEPROM is for. > > The real device is available from the class device via the "device" > link: > > /sys/class/eeprom_dev/eeprom0/device
Sorry for stepping up this late, but I've been working on an eeprom framework recently to move all the duplication that exists in the eeprom drivers (such as sysfs file creation, in kernel accessors) to common code. And part of that work was to create a eeprom class. The only feature that's missing from your code is the label, but I guess it can easily be added, and makes sense. I'm not quite fond of some of the API yet, particularly on the in kernel side, but I guess I can post what I have so far as an RFC and get the discussion started. Maxime -- Maxime Ripard, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
signature.asc
Description: Digital signature