aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2010-11-29 02:14:08 -0500
committerMatthew Garrett <mjg@redhat.com>2011-01-07 17:03:42 -0500
commit4e37b42d5ac0d3f505bcdc09028f3fde82031593 (patch)
tree7e4f5fd8c803bcd0e4f77b01630f526a2a6ac820 /drivers/platform
parentba48fdb969d0404d54f6fa0266373afecbbd19d7 (diff)
eeepc-wmi: use attribute group to manage attributes
Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/eeepc-wmi.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c
index fb548f4b03e0..a70d76a463a6 100644
--- a/drivers/platform/x86/eeepc-wmi.c
+++ b/drivers/platform/x86/eeepc-wmi.c
@@ -560,24 +560,23 @@ static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr,
560 560
561static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv); 561static DEVICE_ATTR(cpufv, S_IRUGO | S_IWUSR, NULL, store_cpufv);
562 562
563static struct attribute *platform_attributes[] = {
564 &dev_attr_cpufv.attr,
565 NULL
566};
567
568static struct attribute_group platform_attribute_group = {
569 .attrs = platform_attributes
570};
571
563static void eeepc_wmi_sysfs_exit(struct platform_device *device) 572static void eeepc_wmi_sysfs_exit(struct platform_device *device)
564{ 573{
565 device_remove_file(&device->dev, &dev_attr_cpufv); 574 sysfs_remove_group(&device->dev.kobj, &platform_attribute_group);
566} 575}
567 576
568static int eeepc_wmi_sysfs_init(struct platform_device *device) 577static int eeepc_wmi_sysfs_init(struct platform_device *device)
569{ 578{
570 int retval = -ENOMEM; 579 return sysfs_create_group(&device->dev.kobj, &platform_attribute_group);
571
572 retval = device_create_file(&device->dev, &dev_attr_cpufv);
573 if (retval)
574 goto error_sysfs;
575
576 return 0;
577
578error_sysfs:
579 eeepc_wmi_sysfs_exit(device);
580 return retval;
581} 580}
582 581
583/* 582/*