hwmon: (pmbus) Initialize sysfs attributes
authorGuenter Roeck <guenter.roeck@ericsson.com>
Tue, 24 May 2011 19:16:40 +0000 (12:16 -0700)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Fri, 27 May 2011 09:24:54 +0000 (02:24 -0700)
Initialize sysfs attrs before device_create_file() call to suppress
lockdep_init_map() warning:

WARNING: at kernel/lockdep.c:2701 lockdep_init_map+0x12d/0x140()

Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org # .39.x
drivers/hwmon/pmbus_core.c

index 98799ba..354770e 100644 (file)
@@ -707,6 +707,7 @@ do {                                                                        \
        struct sensor_device_attribute *a                               \
            = &data->_type##s[data->num_##_type##s].attribute;          \
        BUG_ON(data->num_attributes >= data->max_attributes);           \
+       sysfs_attr_init(&a->dev_attr.attr);                             \
        a->dev_attr.attr.name = _name;                                  \
        a->dev_attr.attr.mode = _mode;                                  \
        a->dev_attr.show = _show;                                       \