diff options
| -rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index d379e74a05d..789d6ae003f 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
| @@ -150,8 +150,6 @@ struct eeepc_hotk { | |||
| 150 | /* The actual device the driver binds to */ | 150 | /* The actual device the driver binds to */ |
| 151 | static struct eeepc_hotk *ehotk; | 151 | static struct eeepc_hotk *ehotk; |
| 152 | 152 | ||
| 153 | static void eeepc_rfkill_hotplug(bool real); | ||
| 154 | |||
| 155 | /* Platform device/driver */ | 153 | /* Platform device/driver */ |
| 156 | static int eeepc_hotk_thaw(struct device *device); | 154 | static int eeepc_hotk_thaw(struct device *device); |
| 157 | static int eeepc_hotk_restore(struct device *device); | 155 | static int eeepc_hotk_restore(struct device *device); |
| @@ -345,16 +343,7 @@ static bool eeepc_wlan_rfkill_blocked(void) | |||
| 345 | static int eeepc_rfkill_set(void *data, bool blocked) | 343 | static int eeepc_rfkill_set(void *data, bool blocked) |
| 346 | { | 344 | { |
| 347 | unsigned long asl = (unsigned long)data; | 345 | unsigned long asl = (unsigned long)data; |
| 348 | int ret; | 346 | return set_acpi(asl, !blocked); |
| 349 | |||
| 350 | if (asl != CM_ASL_WLAN) | ||
| 351 | return set_acpi(asl, !blocked); | ||
| 352 | |||
| 353 | /* hack to avoid panic with rt2860sta */ | ||
| 354 | if (blocked) | ||
| 355 | eeepc_rfkill_hotplug(false); | ||
| 356 | ret = set_acpi(asl, !blocked); | ||
| 357 | return ret; | ||
| 358 | } | 347 | } |
| 359 | 348 | ||
| 360 | static const struct rfkill_ops eeepc_rfkill_ops = { | 349 | static const struct rfkill_ops eeepc_rfkill_ops = { |
| @@ -654,13 +643,13 @@ static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot, | |||
| 654 | return 0; | 643 | return 0; |
| 655 | } | 644 | } |
| 656 | 645 | ||
| 657 | static void eeepc_rfkill_hotplug(bool real) | 646 | static void eeepc_rfkill_hotplug(void) |
| 658 | { | 647 | { |
| 659 | struct pci_dev *dev; | 648 | struct pci_dev *dev; |
| 660 | struct pci_bus *bus; | 649 | struct pci_bus *bus; |
| 661 | bool blocked = real ? eeepc_wlan_rfkill_blocked() : true; | 650 | bool blocked = eeepc_wlan_rfkill_blocked(); |
| 662 | 651 | ||
| 663 | if (real && ehotk->wlan_rfkill) | 652 | if (ehotk->wlan_rfkill) |
| 664 | rfkill_set_sw_state(ehotk->wlan_rfkill, blocked); | 653 | rfkill_set_sw_state(ehotk->wlan_rfkill, blocked); |
| 665 | 654 | ||
| 666 | mutex_lock(&ehotk->hotplug_lock); | 655 | mutex_lock(&ehotk->hotplug_lock); |
| @@ -703,7 +692,7 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data) | |||
| 703 | if (event != ACPI_NOTIFY_BUS_CHECK) | 692 | if (event != ACPI_NOTIFY_BUS_CHECK) |
| 704 | return; | 693 | return; |
| 705 | 694 | ||
| 706 | eeepc_rfkill_hotplug(true); | 695 | eeepc_rfkill_hotplug(); |
| 707 | } | 696 | } |
| 708 | 697 | ||
| 709 | static void eeepc_hotk_notify(struct acpi_device *device, u32 event) | 698 | static void eeepc_hotk_notify(struct acpi_device *device, u32 event) |
| @@ -861,7 +850,7 @@ static int eeepc_hotk_restore(struct device *device) | |||
| 861 | { | 850 | { |
| 862 | /* Refresh both wlan rfkill state and pci hotplug */ | 851 | /* Refresh both wlan rfkill state and pci hotplug */ |
| 863 | if (ehotk->wlan_rfkill) | 852 | if (ehotk->wlan_rfkill) |
| 864 | eeepc_rfkill_hotplug(true); | 853 | eeepc_rfkill_hotplug(); |
| 865 | 854 | ||
| 866 | if (ehotk->bluetooth_rfkill) | 855 | if (ehotk->bluetooth_rfkill) |
| 867 | rfkill_set_sw_state(ehotk->bluetooth_rfkill, | 856 | rfkill_set_sw_state(ehotk->bluetooth_rfkill, |
| @@ -1004,7 +993,7 @@ static void eeepc_rfkill_exit(void) | |||
| 1004 | * Refresh pci hotplug in case the rfkill state was changed after | 993 | * Refresh pci hotplug in case the rfkill state was changed after |
| 1005 | * eeepc_unregister_rfkill_notifier() | 994 | * eeepc_unregister_rfkill_notifier() |
| 1006 | */ | 995 | */ |
| 1007 | eeepc_rfkill_hotplug(true); | 996 | eeepc_rfkill_hotplug(); |
| 1008 | if (ehotk->hotplug_slot) | 997 | if (ehotk->hotplug_slot) |
| 1009 | pci_hp_deregister(ehotk->hotplug_slot); | 998 | pci_hp_deregister(ehotk->hotplug_slot); |
| 1010 | 999 | ||
| @@ -1120,7 +1109,7 @@ static int eeepc_rfkill_init(struct device *dev) | |||
| 1120 | * Refresh pci hotplug in case the rfkill state was changed during | 1109 | * Refresh pci hotplug in case the rfkill state was changed during |
| 1121 | * setup. | 1110 | * setup. |
| 1122 | */ | 1111 | */ |
| 1123 | eeepc_rfkill_hotplug(true); | 1112 | eeepc_rfkill_hotplug(); |
| 1124 | 1113 | ||
| 1125 | exit: | 1114 | exit: |
| 1126 | if (result && result != -ENODEV) | 1115 | if (result && result != -ENODEV) |
