hwmon: (s3c) Initialize sysfs attributes
PATCH 5/5 hwmon: (s3c) 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/s3c-hwmon.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/hwmon/s3c-hwmon.c +1 -0
@@ -232,6 +232,7 @@ static int s3c_hwmon_create_attr(struct device *dev, attr = &attrs->in; attr->index = channel; +sysfs_attr_init (&attr->dev_attr.attr); attr->dev_attr.attr.name = attrs->in_name; attr->dev_attr.attr.mode =S_IRUGO ; attr->dev_attr.show = s3c_hwmon_ch_show;
Signature · 7 lines
1.7.3.1 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH 5/5] hwmon: (s3c) Initialize sysfs
Hi Guenter,
Quoted 6 lines · Guenter Roeck
Initialize dynamically allocated sysfs attributes before
device_create_file()call to suppresslockdep_init_map()warning if lockdep debugging is enabled.Signed-off-by Guenter Roeck <[email protected]>---
Compile tested only.
Seems incomplete to me...
Quoted 9 lines
drivers/hwmon/s3c-hwmon.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/hwmon/s3c-hwmon.c +0
-0
drivers/hwmon/s3c-hwmon.c static int s3c_hwmon_create_attr(struct device *dev, · line 238
Quoted 7 lines
drivers/hwmon/s3c-hwmon.c +1
-0@@ -232,6 +232,7 @@ static int s3c_hwmon_create_attr(struct device *dev, attr = &attrs->in; attr->index = channel; +sysfs_attr_init (&attr->dev_attr.attr); attr->dev_attr.attr.name = attrs->in_name; attr->dev_attr.attr.mode =S_IRUGO ; attr->dev_attr.show = s3c_hwmon_ch_show;
A few lines below, a second optional attribute is used for the label. So you also need:
drivers/hwmon/s3c-hwmon.c +1 -0
@@ -250,6 +250,7 @@ static int s3c_hwmon_create_attr(struct attr = &attrs->label; attr->index = channel; +sysfs_attr_init (&attr->dev_attr.attr); attr->dev_attr.attr.name = attrs->label_name; attr->dev_attr.attr.mode =S_IRUGO ; attr->dev_attr.show = s3c_hwmon_label_show;
(Not even build-tested, but that should work.)
With this change added:
Thanks for finally fixing all these warnings, BTW, they've been there for quite some time...
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [lm-sensors] [PATCH 5/5] hwmon: (s3c) Initialize sysfs
In reply to Guenter RoeckQuoted 43 lines · Jean Delvare
Hi Guenter,
Quoted 6 lines · Guenter Roeck
Initialize dynamically allocated sysfs attributes before
device_create_file()call to suppresslockdep_init_map()warning if lockdep debugging is enabled.Signed-off-by Guenter Roeck <[email protected]>---
Compile tested only.Seems incomplete to me...
Quoted 9 lines
drivers/hwmon/s3c-hwmon.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/hwmon/s3c-hwmon.c +0
-0drivers/hwmon/s3c-hwmon.c static int s3c_hwmon_create_attr(struct device *dev, · line 238
Quoted 7 lines
drivers/hwmon/s3c-hwmon.c +1
-0@@ -232,6 +232,7 @@ static int s3c_hwmon_create_attr(struct device *dev, attr = &attrs->in; attr->index = channel; +sysfs_attr_init (&attr->dev_attr.attr); attr->dev_attr.attr.name = attrs->in_name; attr->dev_attr.attr.mode =S_IRUGO ; attr->dev_attr.show = s3c_hwmon_ch_show;A few lines below, a second optional attribute is used for the label. So you also need:
drivers/hwmon/s3c-hwmon.c +1
-0@@ -250,6 +250,7 @@ static int s3c_hwmon_create_attr(struct attr = &attrs->label; attr->index = channel; +sysfs_attr_init (&attr->dev_attr.attr); attr->dev_attr.attr.name = attrs->label_name; attr->dev_attr.attr.mode =S_IRUGO ; attr->dev_attr.show = s3c_hwmon_label_show;
Quoted 6 lines
(Not even build-tested, but that should work.)
With this change added:
Acked-by Jean Delvare <[email protected]>
Good catch, fixed, applied, and added Cc: for stable.
Quoted 3 lines
Thanks for finally fixing all these warnings, BTW, they've been there for quite some time...
Yes, I figured since I was looking into the problem anyway after it was found in the coretemp driver, I should spend the time to track it down everywhere ... I just hope I found all instances.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors