diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-05-24 23:19:05 +0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-06-18 10:22:26 +0400 |
commit | 9a2d55be1168b56a5c65321dcce64c97798eaec7 (patch) | |
tree | 59130ea83f3639794570dfe56c9a9d89a81f9658 /drivers/hwmon | |
parent | 808b4e639eb00394de9989fabca23196c337ee75 (diff) | |
download | linux-9a2d55be1168b56a5c65321dcce64c97798eaec7.tar.xz |
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: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Luca Tettamanti <kronos.it@gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/asus_atk0110.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index b5e892017e0c..dcb78a7a8047 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -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; |