To make lockdep happy, dynamically allocated sysfs attributes
need to be init'ed.
From include/linux/sysfs.h:
/**
* sysfs_attr_init - initialize a dynamically allocated sysfs attribute
* @attr: struct attribute to initialize
*
* Initialize a dynamically allocated struct attribute so we can
* make lockdep happy. This is a new requirement for attributes
* and initially this is only needed when lockdep is enabled.
* Lockdep gives a nice error when your attribute is added to
* sysfs if you don't have this.
*/
BUG=chromium-os:19521
TEST=Verified that lockdep no longer complains at boot.
Change-Id: I2edc3d22df1a63e5b8b880a524684fe3f96faacd
Signed-off-by: Mandeep Singh Baines <msb@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/6490
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
return NULL;
}
+ sysfs_attr_init(&paa->dev_attr.attr);
paa->dev_attr.attr.mode = 0444; /* read only */
paa->dev_attr.show = show_acpi_attribute;
paa->value = (char *)(paa + 1);