[RFC PATCH dtc] C-based DT schema checker integrated into dtc

Arnd Bergmann arnd at arndb.de
Tue Nov 5 14:34:00 EST 2013


On Tuesday 05 November 2013, Jason Gunthorpe wrote:
> The issue is sysfs, the TPM core attaches attributes to the driver's
> struct device, which means it has to convert from struct device * to
> its own private data. It is totally wrong, but that is the way
> it has been for ever. :(

I've just had a very brief look at that subsystem, and the first driver
I looked at (tpm_atmel) actually creates a child platform_device for
the sole purpose of registering that with the tpm subsystem, which seems
to avoid this problem. Maybe the same can be done for the other drivers
as well. Unfortunately, that will change the sysfs structure, which might
break user space relying on the current path to the device. The TPM
subsystem definely seems a bit unusual in this regard, so I hope not too
many other parts of the kernel have this particular problem.

(side note: another unusual aspect of the TPM subsystem is the use of a
 custom 'release' function override. Seems harmless, but very weird).	

	Arnd



More information about the linux-arm-kernel mailing list