Commit b1e698db authored by Guenter Roeck's avatar Guenter Roeck

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.
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 2.6.34+
parent fb794e0f
...@@ -232,6 +232,7 @@ static int s3c_hwmon_create_attr(struct device *dev, ...@@ -232,6 +232,7 @@ static int s3c_hwmon_create_attr(struct device *dev,
attr = &attrs->in; attr = &attrs->in;
attr->index = channel; attr->index = channel;
sysfs_attr_init(&attr->dev_attr.attr);
attr->dev_attr.attr.name = attrs->in_name; attr->dev_attr.attr.name = attrs->in_name;
attr->dev_attr.attr.mode = S_IRUGO; attr->dev_attr.attr.mode = S_IRUGO;
attr->dev_attr.show = s3c_hwmon_ch_show; attr->dev_attr.show = s3c_hwmon_ch_show;
...@@ -249,6 +250,7 @@ static int s3c_hwmon_create_attr(struct device *dev, ...@@ -249,6 +250,7 @@ static int s3c_hwmon_create_attr(struct device *dev,
attr = &attrs->label; attr = &attrs->label;
attr->index = channel; attr->index = channel;
sysfs_attr_init(&attr->dev_attr.attr);
attr->dev_attr.attr.name = attrs->label_name; attr->dev_attr.attr.name = attrs->label_name;
attr->dev_attr.attr.mode = S_IRUGO; attr->dev_attr.attr.mode = S_IRUGO;
attr->dev_attr.show = s3c_hwmon_label_show; attr->dev_attr.show = s3c_hwmon_label_show;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment