hwmon: (asus_atk0110) Initialize sysfs
Subsystems (2)
PATCH 2/5 hwmon: (asus_atk0110) Initialize sysfs
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/asus_atk0110.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/asus_atk0110.c +1 -0
@@ -268,6 +268,7 @@ static struct device_attribute atk_name_attr static void atk_init_attribute(struct device_attribute *attr, char *name, sysfs_show_func show) { +sysfs_attr_init (&attr->attr); attr->attr.name = name; attr->attr.mode =0444 ; attr->show = show;
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Luca Tettamanti
maintainerQuoted 2 lines · Guenter Roeck
Initialize dynamically allocated sysfs attributes before
device_create_file()call to suppresslockdep_init_map()warning if lockdep debugging is enabled.
Hum, I think this has already been fixed by a30dcb4f, the initialization is done in atk_create_files.
I like your patch better though...
What about this:
drivers/hwmon/asus_atk0110.c +1 -4
@@ -268,6 +268,7 @@ static struct device_attribute atk_name_attr static void atk_init_attribute(struct device_attribute *attr, char *name, sysfs_show_func show) { +sysfs_attr_init (&attr->attr); attr->attr.name = name; attr->attr.mode =0444 ; attr->show = show;
@@ -1188,19 +1189,15 @@ static int atk_create_files(struct atk_data *data)int err;list_for_each_entry (s, &data->sensor_list, list) { -sysfs_attr_init (&s->input_attr.attr); err =device_create_file (data->hwmon_dev, &s->input_attr);if (err)return err; -sysfs_attr_init (&s->label_attr.attr); err =device_create_file (data->hwmon_dev, &s->label_attr);if (err)return err; -sysfs_attr_init (&s->limit1_attr.attr); err =device_create_file (data->hwmon_dev, &s->limit1_attr);if (err)return err; -sysfs_attr_init (&s->limit2_attr.attr); err =device_create_file (data->hwmon_dev, &s->limit2_attr);if (err)return err;
Luca
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 42 lines · Luca Tettamanti
Quoted 2 lines · Guenter Roeck
Initialize dynamically allocated sysfs attributes before
device_create_file()call to suppresslockdep_init_map()warning if lockdep debugging is enabled.Hum, I think this has already been fixed by
a30dcb4f, the initialization is done inatk_create_files.
I like your patch better though...What about this:
drivers/hwmon/asus_atk0110.c +1
-4@@ -268,6 +268,7 @@ static struct device_attribute atk_name_attr > static void atk_init_attribute(struct device_attribute *attr, char *name, sysfs_show_func show) { +sysfs_attr_init (&attr->attr); attr->attr.name = name; attr->attr.mode =0444 ; attr->show = show;@@ -1188,19 +1189,15 @@ static int atk_create_files(struct atk_data *data)int err;list_for_each_entry (s, &data->sensor_list, list) { -sysfs_attr_init (&s->input_attr.attr); err =device_create_file (data->hwmon_dev, &s->input_attr);if (err)return err; -sysfs_attr_init (&s->label_attr.attr); err =device_create_file (data->hwmon_dev, &s->label_attr);if (err)return err; -sysfs_attr_init (&s->limit1_attr.attr); err =device_create_file (data->hwmon_dev, &s->limit1_attr);if (err)return err; -sysfs_attr_init (&s->limit2_attr.attr); err =device_create_file (data->hwmon_dev, &s->limit2_attr);if (err)return err;
Quoted 1 line
Luca
Hi Luca,
Reminder to self: When looking for missing initializations, look everywhere ;).
I'll modify the patch as you suggested.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors