Commit 4e37b42d authored by Corentin Chary's avatar Corentin Chary Committed by Matthew Garrett

eeepc-wmi: use attribute group to manage attributes

Signed-off-by: default avatarCorentin Chary <corentincj@iksaif.net>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent ba48fdb9
...@@ -560,24 +560,23 @@ static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr, ...@@ -560,24 +560,23 @@ static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv); static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
static struct attribute *platform_attributes[] = {
&dev_attr_cpufv.attr,
NULL
};
static struct attribute_group platform_attribute_group = {
.attrs = platform_attributes
};
static void eeepc_wmi_sysfs_exit(struct platform_device *device) static void eeepc_wmi_sysfs_exit(struct platform_device *device)
{ {
device_remove_file(&device->dev, &dev_attr_cpufv); sysfs_remove_group(&device->dev.kobj, &platform_attribute_group);
} }
static int eeepc_wmi_sysfs_init(struct platform_device *device) static int eeepc_wmi_sysfs_init(struct platform_device *device)
{ {
int retval = -ENOMEM; return sysfs_create_group(&device->dev.kobj, &platform_attribute_group);
retval = device_create_file(&device->dev, &dev_attr_cpufv);
if (retval)
goto error_sysfs;
return 0;
error_sysfs:
eeepc_wmi_sysfs_exit(device);
return retval;
} }
/* /*
......
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