aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/hp-wmi.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 5c8ae65950d4..f6a1c37af9cc 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -532,7 +532,7 @@ static void cleanup_sysfs(struct platform_device *device)
532 device_remove_file(&device->dev, &dev_attr_tablet); 532 device_remove_file(&device->dev, &dev_attr_tablet);
533} 533}
534 534
535static int __devinit hp_wmi_bios_setup(struct platform_device *device) 535static int __devinit hp_wmi_rfkill_setup(struct platform_device *device)
536{ 536{
537 int err; 537 int err;
538 int wireless = 0; 538 int wireless = 0;
@@ -542,22 +542,6 @@ static int __devinit hp_wmi_bios_setup(struct platform_device *device)
542 if (err) 542 if (err)
543 return err; 543 return err;
544 544
545 err = device_create_file(&device->dev, &dev_attr_display);
546 if (err)
547 goto add_sysfs_error;
548 err = device_create_file(&device->dev, &dev_attr_hddtemp);
549 if (err)
550 goto add_sysfs_error;
551 err = device_create_file(&device->dev, &dev_attr_als);
552 if (err)
553 goto add_sysfs_error;
554 err = device_create_file(&device->dev, &dev_attr_dock);
555 if (err)
556 goto add_sysfs_error;
557 err = device_create_file(&device->dev, &dev_attr_tablet);
558 if (err)
559 goto add_sysfs_error;
560
561 if (wireless & 0x1) { 545 if (wireless & 0x1) {
562 wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev, 546 wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev,
563 RFKILL_TYPE_WLAN, 547 RFKILL_TYPE_WLAN,
@@ -611,6 +595,34 @@ register_bluetooth_error:
611 rfkill_unregister(wifi_rfkill); 595 rfkill_unregister(wifi_rfkill);
612register_wifi_error: 596register_wifi_error:
613 rfkill_destroy(wifi_rfkill); 597 rfkill_destroy(wifi_rfkill);
598 return err;
599}
600
601static int __devinit hp_wmi_bios_setup(struct platform_device *device)
602{
603 int err;
604
605 err = hp_wmi_rfkill_setup(device);
606 if (err)
607 return err;
608
609 err = device_create_file(&device->dev, &dev_attr_display);
610 if (err)
611 goto add_sysfs_error;
612 err = device_create_file(&device->dev, &dev_attr_hddtemp);
613 if (err)
614 goto add_sysfs_error;
615 err = device_create_file(&device->dev, &dev_attr_als);
616 if (err)
617 goto add_sysfs_error;
618 err = device_create_file(&device->dev, &dev_attr_dock);
619 if (err)
620 goto add_sysfs_error;
621 err = device_create_file(&device->dev, &dev_attr_tablet);
622 if (err)
623 goto add_sysfs_error;
624 return 0;
625
614add_sysfs_error: 626add_sysfs_error:
615 cleanup_sysfs(device); 627 cleanup_sysfs(device);
616 return err; 628 return err;