diff options
author | Jean Delvare <khali@linux-fr.org> | 2010-03-05 16:17:16 -0500 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2010-03-05 16:17:16 -0500 |
commit | 6a8d7acfbef8ac6bf34421eae980f903cbe36874 (patch) | |
tree | 2e9715e0f91f4cc09e04747cc86cbc5417395d9f /drivers/hwmon/it87.c | |
parent | 723a0aa0a10f111d7e9e0977d51ac996bf8edbbf (diff) |
hwmon: (it87) Create vid attributes by group
Only VID-related attributes are left in it87_attributes_opt, so we
might as well rename it to it87_attributes_vid and use this group to
create all attributes at once.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r-- | drivers/hwmon/it87.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 5df0824fc832..7a349e066fdc 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -1107,14 +1107,14 @@ static const struct attribute_group it87_group_pwm[3] = { | |||
1107 | { .attrs = it87_attributes_pwm[2] }, | 1107 | { .attrs = it87_attributes_pwm[2] }, |
1108 | }; | 1108 | }; |
1109 | 1109 | ||
1110 | static struct attribute *it87_attributes_opt[] = { | 1110 | static struct attribute *it87_attributes_vid[] = { |
1111 | &dev_attr_vrm.attr, | 1111 | &dev_attr_vrm.attr, |
1112 | &dev_attr_cpu0_vid.attr, | 1112 | &dev_attr_cpu0_vid.attr, |
1113 | NULL | 1113 | NULL |
1114 | }; | 1114 | }; |
1115 | 1115 | ||
1116 | static const struct attribute_group it87_group_opt = { | 1116 | static const struct attribute_group it87_group_vid = { |
1117 | .attrs = it87_attributes_opt, | 1117 | .attrs = it87_attributes_vid, |
1118 | }; | 1118 | }; |
1119 | 1119 | ||
1120 | /* SuperIO detection - will change isa_address if a chip is found */ | 1120 | /* SuperIO detection - will change isa_address if a chip is found */ |
@@ -1250,7 +1250,8 @@ static void it87_remove_files(struct device *dev) | |||
1250 | continue; | 1250 | continue; |
1251 | sysfs_remove_group(&dev->kobj, &it87_group_pwm[i]); | 1251 | sysfs_remove_group(&dev->kobj, &it87_group_pwm[i]); |
1252 | } | 1252 | } |
1253 | sysfs_remove_group(&dev->kobj, &it87_group_opt); | 1253 | if (!sio_data->skip_vid) |
1254 | sysfs_remove_group(&dev->kobj, &it87_group_vid); | ||
1254 | } | 1255 | } |
1255 | 1256 | ||
1256 | static int __devinit it87_probe(struct platform_device *pdev) | 1257 | static int __devinit it87_probe(struct platform_device *pdev) |
@@ -1335,10 +1336,8 @@ static int __devinit it87_probe(struct platform_device *pdev) | |||
1335 | data->vrm = vid_which_vrm(); | 1336 | data->vrm = vid_which_vrm(); |
1336 | /* VID reading from Super-I/O config space if available */ | 1337 | /* VID reading from Super-I/O config space if available */ |
1337 | data->vid = sio_data->vid_value; | 1338 | data->vid = sio_data->vid_value; |
1338 | if ((err = device_create_file(dev, | 1339 | err = sysfs_create_group(&dev->kobj, &it87_group_vid); |
1339 | &dev_attr_vrm)) | 1340 | if (err) |
1340 | || (err = device_create_file(dev, | ||
1341 | &dev_attr_cpu0_vid))) | ||
1342 | goto ERROR4; | 1341 | goto ERROR4; |
1343 | } | 1342 | } |
1344 | 1343 | ||