aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorKirill Tkhai <tkhai@yandex.ru>2013-07-29 09:34:37 -0400
committerMatthew Garrett <matthew.garrett@nebula.com>2013-09-05 08:51:59 -0400
commit5b5c2b3c9b0585350d2da62bc4b990d9bf836d94 (patch)
treebee0947aaa812e43becb6c8884a6fbc4a1069b58 /drivers/platform
parent0db7fd969e567dc0e4d2a7138896d6860f9614d5 (diff)
hp_wmi: Fix unregister order in hp_wmi_rfkill_setup()
Register order is: wifi bluetooth wwan gps So unregister order must be: gps wwan bluetiith wifi But currently gps and wwan are swapped. Fix that. Also fix goto links. Signed-off-by: Kirill Tkhai <tkhai@yandex.ru> CC: Matthew Garrett <matthew.garrett@nebula.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/hp-wmi.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index d6970f47ae72..1c86fa0857c8 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -725,7 +725,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
725 (void *) HPWMI_WWAN); 725 (void *) HPWMI_WWAN);
726 if (!wwan_rfkill) { 726 if (!wwan_rfkill) {
727 err = -ENOMEM; 727 err = -ENOMEM;
728 goto register_gps_error; 728 goto register_bluetooth_error;
729 } 729 }
730 rfkill_init_sw_state(wwan_rfkill, 730 rfkill_init_sw_state(wwan_rfkill,
731 hp_wmi_get_sw_state(HPWMI_WWAN)); 731 hp_wmi_get_sw_state(HPWMI_WWAN));
@@ -733,7 +733,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
733 hp_wmi_get_hw_state(HPWMI_WWAN)); 733 hp_wmi_get_hw_state(HPWMI_WWAN));
734 err = rfkill_register(wwan_rfkill); 734 err = rfkill_register(wwan_rfkill);
735 if (err) 735 if (err)
736 goto register_wwan_err; 736 goto register_wwan_error;
737 } 737 }
738 738
739 if (wireless & 0x8) { 739 if (wireless & 0x8) {
@@ -743,7 +743,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
743 (void *) HPWMI_GPS); 743 (void *) HPWMI_GPS);
744 if (!gps_rfkill) { 744 if (!gps_rfkill) {
745 err = -ENOMEM; 745 err = -ENOMEM;
746 goto register_bluetooth_error; 746 goto register_wwan_error;
747 } 747 }
748 rfkill_init_sw_state(gps_rfkill, 748 rfkill_init_sw_state(gps_rfkill,
749 hp_wmi_get_sw_state(HPWMI_GPS)); 749 hp_wmi_get_sw_state(HPWMI_GPS));
@@ -755,16 +755,16 @@ static int hp_wmi_rfkill_setup(struct platform_device *device)
755 } 755 }
756 756
757 return 0; 757 return 0;
758register_wwan_err:
759 rfkill_destroy(wwan_rfkill);
760 wwan_rfkill = NULL;
761 if (gps_rfkill)
762 rfkill_unregister(gps_rfkill);
763register_gps_error: 758register_gps_error:
764 rfkill_destroy(gps_rfkill); 759 rfkill_destroy(gps_rfkill);
765 gps_rfkill = NULL; 760 gps_rfkill = NULL;
766 if (bluetooth_rfkill) 761 if (bluetooth_rfkill)
767 rfkill_unregister(bluetooth_rfkill); 762 rfkill_unregister(bluetooth_rfkill);
763register_wwan_error:
764 rfkill_destroy(wwan_rfkill);
765 wwan_rfkill = NULL;
766 if (gps_rfkill)
767 rfkill_unregister(gps_rfkill);
768register_bluetooth_error: 768register_bluetooth_error:
769 rfkill_destroy(bluetooth_rfkill); 769 rfkill_destroy(bluetooth_rfkill);
770 bluetooth_rfkill = NULL; 770 bluetooth_rfkill = NULL;