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

From: Arnd Bergmann
Date: Fri Mar 25 2011 - 18:35:23 EST


On Friday 25 March 2011 23:23:46 Jamie Iles wrote:
> Thanks for taking the time to look at this. I think I've addressed all
> of your comments in the v3 series apart from defining OTP (which really
> does need to be done so I'll make sure I do that in v4) and the sysfs
> bus/class stuff.

Wow, that was quick!

One more thing that I just realized:
I think it would be better not to allow arbitrary ioctl commands to
be interpreted by the individual drivers. Instead, interpret them
in the common code and pass the data to the drivers through separate
otp_device_ops function pointers, one per ioctl command.

This will reduce the amount of code needed in each driver when you
have multiple ones implementing the same ioctls, and help to
ensure that they all treat the arguments in the same way.

Also, you should have a compat_ioctl file operation. As long as
your data structures are compatible between 32 and 64 bit, it
can point to the same function as the .unlocked_ioctl one.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/