Explorar el Código

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+
Guenter Roeck hace 14 años
padre
commit
3cdb2052a6
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      drivers/hwmon/ibmaem.c

+ 2 - 0
drivers/hwmon/ibmaem.c

@@ -947,6 +947,7 @@ static int aem_register_sensors(struct aem_data *data,
 
 
 	/* Set up read-only sensors */
 	/* Set up read-only sensors */
 	while (ro->label) {
 	while (ro->label) {
+		sysfs_attr_init(&sensors->dev_attr.attr);
 		sensors->dev_attr.attr.name = ro->label;
 		sensors->dev_attr.attr.name = ro->label;
 		sensors->dev_attr.attr.mode = S_IRUGO;
 		sensors->dev_attr.attr.mode = S_IRUGO;
 		sensors->dev_attr.show = ro->show;
 		sensors->dev_attr.show = ro->show;
@@ -963,6 +964,7 @@ static int aem_register_sensors(struct aem_data *data,
 
 
 	/* Set up read-write sensors */
 	/* Set up read-write sensors */
 	while (rw->label) {
 	while (rw->label) {
+		sysfs_attr_init(&sensors->dev_attr.attr);
 		sensors->dev_attr.attr.name = rw->label;
 		sensors->dev_attr.attr.name = rw->label;
 		sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
 		sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
 		sensors->dev_attr.show = rw->show;
 		sensors->dev_attr.show = rw->show;