Skip to contentSkip to conversation

hwmon: (ibmaem) 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 3/5 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.

---
Compile tested only.

 drivers/hwmon/ibmaem.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/hwmon/ibmaem.c +2 -0
index bc6e2ab..affc17e 100644
@@ -947,6 +947,7 @@ static int aem_register_sensors(struct aem_data *data,
 
 	/* Set up read-only sensors */
 	while (ro->label) {
+		sysfs_attr_init(&sensors->dev_attr.attr);
 		sensors->dev_attr.attr.name = ro->label;
 		sensors->dev_attr.attr.mode = S_IRUGO;
 		sensors->dev_attr.show = ro->show;
@@ -963,6 +964,7 @@ static int aem_register_sensors(struct aem_data *data,
 
 	/* Set up read-write sensors */
 	while (rw->label) {
+		sysfs_attr_init(&sensors->dev_attr.attr);
 		sensors->dev_attr.attr.name = rw->label;
 		sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
 		sensors->dev_attr.show = rw->show;
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 3/5
#1 lore raw

Re: [lm-sensors] [PATCH 3/5] hwmon: (ibmaem) 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 24 lines
 drivers/hwmon/ibmaem.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/hwmon/ibmaem.c +2 -0
index bc6e2ab..affc17e 100644
@@ -947,6 +947,7 @@ static int aem_register_sensors(struct aem_data *data,
 
 	/* Set up read-only sensors */
 	while (ro->label) {
+		sysfs_attr_init(&sensors->dev_attr.attr);
 		sensors->dev_attr.attr.name = ro->label;
 		sensors->dev_attr.attr.mode = S_IRUGO;
 		sensors->dev_attr.show = ro->show;
@@ -963,6 +964,7 @@ static int aem_register_sensors(struct aem_data *data,
 
 	/* Set up read-write sensors */
 	while (rw->label) {
+		sysfs_attr_init(&sensors->dev_attr.attr);
 		sensors->dev_attr.attr.name = rw->label;
 		sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
 		sensors->dev_attr.show = rw->show;
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 3/5] hwmon: (ibmaem) 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, I added the necessary Cc:

Thanks,
Guenter

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