Feature #3270
Updated by Vadim Mutilin about 10 years ago
Initialize *dynamically allocated* sysfs attributes before device_create_file() call to suppress lockdep_init_map() warning if lockdep debugging is enabled (Ńorresponding call sysfs_attr_init should be before the call device_create_file). Device attributes can be allocated *statically and dynamically*. Static allocation of attribute is done via a macro DEVICE_ATTR (instead can be used similar macro, written by the authors of specific driver). Thus, if the attribute is allocated using a macro, there is *no need* to call a function sysfs_attr_init. Example: "ibmaem.c":http://lxr.linux.no/#linux+v3.5/drivers/hwmon/ibmaem.c#L931 *Links* Commits: Sample bugfixes "f40e1a4":https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=f40e1a4, "4ee267b":https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=4ee267b, "af3071a":https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=af3071a, "d631323":https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=d631323 af3071a228ce8e0dc98c8082cee2e95d223bd4fe 4ee267bbbd58bdcf9dc84ebc01a34ff68b5de3ed d631323f1151c09c21985cb1bba8a17eba83ad99 See also: "device.txt":http://lxr.linux.no/#linux+v3.5/Documentation/driver-model/device.txt "sysfs.txt":http://lxr.linux.no/#linux+v3.5/Documentation/filesystems/sysfs.txt