diff options
author | Frans Klaver <fransklaver@gmail.com> | 2014-10-22 15:12:38 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2014-11-19 12:07:08 -0500 |
commit | 792bd2a58f924fca7ed45d0cacfa5ae5cfb42e65 (patch) | |
tree | fa52f53d14014d851e7e50b69d578734aaeeffd8 /drivers/platform/x86 | |
parent | 9f662b20d6cef8afbbf954de66dece78faf4bcc1 (diff) |
eeepc-laptop: define rfkill notifier nodes only once
The rfkill notifier node names are used in three different places. As a
matter of style, it is better to store them somewhere and have the
compiler warn us about typos in the function arguments.
Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 6e3be01ca011..e92ea4187cdf 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -819,11 +819,15 @@ static int eeepc_new_rfkill(struct eeepc_laptop *eeepc, | |||
819 | return 0; | 819 | return 0; |
820 | } | 820 | } |
821 | 821 | ||
822 | static char EEEPC_RFKILL_NODE_1[] = "\\_SB.PCI0.P0P5"; | ||
823 | static char EEEPC_RFKILL_NODE_2[] = "\\_SB.PCI0.P0P6"; | ||
824 | static char EEEPC_RFKILL_NODE_3[] = "\\_SB.PCI0.P0P7"; | ||
825 | |||
822 | static void eeepc_rfkill_exit(struct eeepc_laptop *eeepc) | 826 | static void eeepc_rfkill_exit(struct eeepc_laptop *eeepc) |
823 | { | 827 | { |
824 | eeepc_unregister_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5"); | 828 | eeepc_unregister_rfkill_notifier(eeepc, EEEPC_RFKILL_NODE_1); |
825 | eeepc_unregister_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6"); | 829 | eeepc_unregister_rfkill_notifier(eeepc, EEEPC_RFKILL_NODE_2); |
826 | eeepc_unregister_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7"); | 830 | eeepc_unregister_rfkill_notifier(eeepc, EEEPC_RFKILL_NODE_3); |
827 | if (eeepc->wlan_rfkill) { | 831 | if (eeepc->wlan_rfkill) { |
828 | rfkill_unregister(eeepc->wlan_rfkill); | 832 | rfkill_unregister(eeepc->wlan_rfkill); |
829 | rfkill_destroy(eeepc->wlan_rfkill); | 833 | rfkill_destroy(eeepc->wlan_rfkill); |
@@ -895,9 +899,9 @@ static int eeepc_rfkill_init(struct eeepc_laptop *eeepc) | |||
895 | if (result == -EBUSY) | 899 | if (result == -EBUSY) |
896 | result = 0; | 900 | result = 0; |
897 | 901 | ||
898 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P5"); | 902 | eeepc_register_rfkill_notifier(eeepc, EEEPC_RFKILL_NODE_1); |
899 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P6"); | 903 | eeepc_register_rfkill_notifier(eeepc, EEEPC_RFKILL_NODE_2); |
900 | eeepc_register_rfkill_notifier(eeepc, "\\_SB.PCI0.P0P7"); | 904 | eeepc_register_rfkill_notifier(eeepc, EEEPC_RFKILL_NODE_3); |
901 | 905 | ||
902 | exit: | 906 | exit: |
903 | if (result && result != -ENODEV) | 907 | if (result && result != -ENODEV) |
@@ -933,9 +937,9 @@ static int eeepc_hotk_restore(struct device *device) | |||
933 | 937 | ||
934 | /* Refresh both wlan rfkill state and pci hotplug */ | 938 | /* Refresh both wlan rfkill state and pci hotplug */ |
935 | if (eeepc->wlan_rfkill) { | 939 | if (eeepc->wlan_rfkill) { |
936 | eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P5"); | 940 | eeepc_rfkill_hotplug_update(eeepc, EEEPC_RFKILL_NODE_1); |
937 | eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P6"); | 941 | eeepc_rfkill_hotplug_update(eeepc, EEEPC_RFKILL_NODE_2); |
938 | eeepc_rfkill_hotplug_update(eeepc, "\\_SB.PCI0.P0P7"); | 942 | eeepc_rfkill_hotplug_update(eeepc, EEEPC_RFKILL_NODE_3); |
939 | } | 943 | } |
940 | 944 | ||
941 | if (eeepc->bluetooth_rfkill) | 945 | if (eeepc->bluetooth_rfkill) |