Skip to contentSkip to conversation

hwmon: (ibmpex) Initialize sysfs attributes

PATCH Applied Guenter Roeck 2 participants 3 messages May 24, 2011 – Jun 11, 2011 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 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.

---
Compile tested only.

 drivers/hwmon/ibmpex.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/ibmpex.c +1 -0
index 06d4eaf..41dbf81 100644
@@ -358,6 +358,7 @@ static int create_sensor(struct ibmpex_bmc_data *data, int type,
 	else if (type = POWER_SENSOR)
 		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.mode = S_IRUGO;
 	data->sensors[sensor].attr[func].dev_attr.show = ibmpex_show_sensor;
Signature · 7 lines
1.7.3.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 4/5
#1 lore raw

Re: [lm-sensors] [PATCH 4/5] hwmon: (ibmpex) Initialize sysfs

Quoted 6 lines · Guenter Roeck

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

---
Compile tested only.

Can't test either, but looks good to me:

Candidate for stable series?

Quoted 16 lines
 drivers/hwmon/ibmpex.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/ibmpex.c +1 -0
index 06d4eaf..41dbf81 100644
@@ -358,6 +358,7 @@ static int create_sensor(struct ibmpex_bmc_data *data, int type,
 	else if (type = POWER_SENSOR)
 		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.mode = S_IRUGO;
 	data->sensors[sensor].attr[func].dev_attr.show = ibmpex_show_sensor;
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
author Applied
#2 lore raw

Re: [lm-sensors] [PATCH 4/5] hwmon: (ibmpex) Initialize sysfs

In reply to Guenter Roeck
Quoted 4 lines · Jean Delvare
Quoted 3 lines · Guenter Roeck

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

Quoted 8 lines
Quoted 3 lines

---
Compile tested only.

Can't test either, but looks good to me:

Applied,

Quoted 2 lines

Candidate for stable series?

Yes, added Cc:.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors