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>
This commit is contained in:
@@ -1107,14 +1107,14 @@ static const struct attribute_group it87_group_pwm[3] = {
|
|||||||
{ .attrs = it87_attributes_pwm[2] },
|
{ .attrs = it87_attributes_pwm[2] },
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct attribute *it87_attributes_opt[] = {
|
static struct attribute *it87_attributes_vid[] = {
|
||||||
&dev_attr_vrm.attr,
|
&dev_attr_vrm.attr,
|
||||||
&dev_attr_cpu0_vid.attr,
|
&dev_attr_cpu0_vid.attr,
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct attribute_group it87_group_opt = {
|
static const struct attribute_group it87_group_vid = {
|
||||||
.attrs = it87_attributes_opt,
|
.attrs = it87_attributes_vid,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* SuperIO detection - will change isa_address if a chip is found */
|
/* SuperIO detection - will change isa_address if a chip is found */
|
||||||
@@ -1250,7 +1250,8 @@ static void it87_remove_files(struct device *dev)
|
|||||||
continue;
|
continue;
|
||||||
sysfs_remove_group(&dev->kobj, &it87_group_pwm[i]);
|
sysfs_remove_group(&dev->kobj, &it87_group_pwm[i]);
|
||||||
}
|
}
|
||||||
sysfs_remove_group(&dev->kobj, &it87_group_opt);
|
if (!sio_data->skip_vid)
|
||||||
|
sysfs_remove_group(&dev->kobj, &it87_group_vid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int __devinit it87_probe(struct platform_device *pdev)
|
static int __devinit it87_probe(struct platform_device *pdev)
|
||||||
@@ -1335,10 +1336,8 @@ static int __devinit it87_probe(struct platform_device *pdev)
|
|||||||
data->vrm = vid_which_vrm();
|
data->vrm = vid_which_vrm();
|
||||||
/* VID reading from Super-I/O config space if available */
|
/* VID reading from Super-I/O config space if available */
|
||||||
data->vid = sio_data->vid_value;
|
data->vid = sio_data->vid_value;
|
||||||
if ((err = device_create_file(dev,
|
err = sysfs_create_group(&dev->kobj, &it87_group_vid);
|
||||||
&dev_attr_vrm))
|
if (err)
|
||||||
|| (err = device_create_file(dev,
|
|
||||||
&dev_attr_cpu0_vid)))
|
|
||||||
goto ERROR4;
|
goto ERROR4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user