Commit 9a2d55be authored by Guenter Roeck's avatar Guenter Roeck

hwmon: (asus_atk0110) Consolidate sysfs attribute initialization

Call sysfs_attr_init() from atk_init_attribute() to handle sysfs attribute
initialization in a single function.
Signed-off-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Cc: Luca Tettamanti <kronos.it@gmail.com>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
parent 808b4e63
...@@ -268,6 +268,7 @@ static struct device_attribute atk_name_attr = ...@@ -268,6 +268,7 @@ static struct device_attribute atk_name_attr =
static void atk_init_attribute(struct device_attribute *attr, char *name, static void atk_init_attribute(struct device_attribute *attr, char *name,
sysfs_show_func show) sysfs_show_func show)
{ {
sysfs_attr_init(&attr->attr);
attr->attr.name = name; attr->attr.name = name;
attr->attr.mode = 0444; attr->attr.mode = 0444;
attr->show = show; attr->show = show;
...@@ -1188,19 +1189,15 @@ static int atk_create_files(struct atk_data *data) ...@@ -1188,19 +1189,15 @@ static int atk_create_files(struct atk_data *data)
int err; int err;
list_for_each_entry(s, &data->sensor_list, list) { 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); err = device_create_file(data->hwmon_dev, &s->input_attr);
if (err) if (err)
return err; return err;
sysfs_attr_init(&s->label_attr.attr);
err = device_create_file(data->hwmon_dev, &s->label_attr); err = device_create_file(data->hwmon_dev, &s->label_attr);
if (err) if (err)
return err; return err;
sysfs_attr_init(&s->limit1_attr.attr);
err = device_create_file(data->hwmon_dev, &s->limit1_attr); err = device_create_file(data->hwmon_dev, &s->limit1_attr);
if (err) if (err)
return err; return err;
sysfs_attr_init(&s->limit2_attr.attr);
err = device_create_file(data->hwmon_dev, &s->limit2_attr); err = device_create_file(data->hwmon_dev, &s->limit2_attr);
if (err) if (err)
return err; return err;
......
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