Commit 3cdb2052a6e365ad56202874e6a8a05a2bb336fc

Authored by Guenter Roeck
1 parent 9a2d55be11

hwmon: (ibmaem) Initialize sysfs attributes

Initialize dynamically allocated sysfs attributes before device_create_file()
call to suppress lockdep_init_map() warning if lockdep debugging is enabled.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

drivers/hwmon/ibmaem.c
... ... @@ -947,6 +947,7 @@
947 947  
948 948 /* Set up read-only sensors */
949 949 while (ro->label) {
  950 + sysfs_attr_init(&sensors->dev_attr.attr);
950 951 sensors->dev_attr.attr.name = ro->label;
951 952 sensors->dev_attr.attr.mode = S_IRUGO;
952 953 sensors->dev_attr.show = ro->show;
... ... @@ -963,6 +964,7 @@
963 964  
964 965 /* Set up read-write sensors */
965 966 while (rw->label) {
  967 + sysfs_attr_init(&sensors->dev_attr.attr);
966 968 sensors->dev_attr.attr.name = rw->label;
967 969 sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
968 970 sensors->dev_attr.show = rw->show;