CHROMIUM: chromeos_acpi: make lockdep happy
authorMandeep Singh Baines <msb@chromium.org>
Tue, 23 Aug 2011 17:07:25 +0000 (10:07 -0700)
committerGrant Grundler <grundler@google.com>
Thu, 24 May 2012 22:14:36 +0000 (15:14 -0700)
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>
drivers/platform/x86/chromeos_acpi.c

index 61e52f7..aa4b9ca 100644 (file)
@@ -324,6 +324,7 @@ static struct acpi_attribute *create_sysfs_attribute(char *value, char *name,
                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);