Skip to content

Commit

Permalink
hwmon: (s3c) Initialize sysfs attributes
Browse files Browse the repository at this point in the history
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+
  • Loading branch information
Guenter Roeck committed Jun 18, 2011
1 parent fb794e0 commit b1e698d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hwmon/s3c-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -249,6 +250,7 @@ static int s3c_hwmon_create_attr(struct device *dev,

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;
Expand Down

0 comments on commit b1e698d

Please sign in to comment.