aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/eeepc-laptop.c
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2009-10-16 16:22:46 -0400
committerLen Brown <len.brown@intel.com>2009-11-03 10:23:52 -0500
commit58ce48a9de1dd47acb5dc00e2837214d2be1d92a (patch)
treeac5ad3eecd6271e5d99c9ba16eb86bf42d164d51 /drivers/platform/x86/eeepc-laptop.c
parent012abeea669ea49636cf952d13298bb68654146a (diff)
Revert "eeepc-laptop: Prevent a panic when disabling RT2860 wireless when associated"
rt2860sta is fine with the patch as is, but iwl3945 isn't (eeepc_rfkill_set() needs to call eeepc_rfkill_hotplug(true) – which means that we're back to causing the rt2860sta panic This reverts commit b56ab33d68638e6aafdbfc694025e8354a628f49. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform/x86/eeepc-laptop.c')
-rw-r--r--drivers/platform/x86/eeepc-laptop.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index d379e74a05d0..789d6ae003fb 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 */
151static struct eeepc_hotk *ehotk; 151static struct eeepc_hotk *ehotk;
152 152
153static void eeepc_rfkill_hotplug(bool real);
154
155/* Platform device/driver */ 153/* Platform device/driver */
156static int eeepc_hotk_thaw(struct device *device); 154static int eeepc_hotk_thaw(struct device *device);
157static int eeepc_hotk_restore(struct device *device); 155static int eeepc_hotk_restore(struct device *device);
@@ -345,16 +343,7 @@ static bool eeepc_wlan_rfkill_blocked(void)
345static int eeepc_rfkill_set(void *data, bool blocked) 343static 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
360static const struct rfkill_ops eeepc_rfkill_ops = { 349static 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
657static void eeepc_rfkill_hotplug(bool real) 646static 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
709static void eeepc_hotk_notify(struct acpi_device *device, u32 event) 698static 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
1125exit: 1114exit:
1126 if (result && result != -ENODEV) 1115 if (result && result != -ENODEV)