Re: [RFC PATCHv2 1/4] drivers/otp: add initial support for OTP memory

Greg KH
2011-03-25T21:16:01Z

On Fri, Mar 25, 2011 at 09:12:22PM +0100, Arnd Bergmann wrote:
> On Thursday 24 March 2011 16:21:08 Jamie Iles wrote:
> > OTP memory is typically found in some embedded devices and can be
> > used for storing boot code, cryptographic keys and other persistent
> > information onchip. This patch adds a generic layer that devices can
> > register OTP with and allows access through a set of character
> > device nodes.
>
> Looks very nice overall, but I have a few minor comments.
>
> > diff --git a/Documentation/ABI/testing/sysfs-bus-otp b/Documentation/ABI/testing/sysfs-bus-otp
> > new file mode 100644
> > index 0000000..4dbc652
> > --- /dev/null
> > +++ b/Documentation/ABI/testing/sysfs-bus-otp
> > @@ -0,0 +1,68 @@
> > +What: /sys/bus/otp/
> > +Date: March 2011
> > +KernelVersion: 2.6.40+
> > +Contact: Jamie Iles <jamie@jamieiles.com>
> > +Description:
> > + The otp bus presents a number of devices where each
> > + device represents a region or device in the SoC. Each region
> > + will create a device node which allows the region to be
> > + written with read()/write() calls and the device on the bus
> > + has attributes for controlling the redundancy format and
> > + getting the region size.
>
> Why is this a bus? You don't have any device matching code or similar,
> and the devices typically are on an existing bus_type (e.g. platform_bus).
> I think it would make more sense to do this as a class.

No, for new things, we want to use busses instead of classes please.
Especially as this does create devices, which are best put on a bus
somewhere.

thanks,

greg k-h