Commit fb794e0f authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (ibmpex) 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: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
parent 3cdb2052
...@@ -358,6 +358,7 @@ static int create_sensor(struct ibmpex_bmc_data *data, int type, ...@@ -358,6 +358,7 @@ static int create_sensor(struct ibmpex_bmc_data *data, int type,
else if (type == POWER_SENSOR) else if (type == POWER_SENSOR)
sprintf(n, power_sensor_name_templates[func], "power", counter); sprintf(n, power_sensor_name_templates[func], "power", counter);
sysfs_attr_init(&data->sensors[sensor].attr[func].dev_attr.attr);
data->sensors[sensor].attr[func].dev_attr.attr.name = n; data->sensors[sensor].attr[func].dev_attr.attr.name = n;
data->sensors[sensor].attr[func].dev_attr.attr.mode = S_IRUGO; data->sensors[sensor].attr[func].dev_attr.attr.mode = S_IRUGO;
data->sensors[sensor].attr[func].dev_attr.show = ibmpex_show_sensor; data->sensors[sensor].attr[func].dev_attr.show = ibmpex_show_sensor;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment