aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee, Chun-Yi <jlee@novell.com>2010-05-14 18:18:54 -0400
committerMatthew Garrett <mjg@redhat.com>2010-05-20 09:46:12 -0400
commit7ab52521f2d850e922f33e5586a47e6c83ec6f11 (patch)
treedc7d1d34b534aa7fa92685a4b4c5849916d1228e
parent1ac34072bda53e889ac1c5a73ea59f42a769485a (diff)
Clean up all objects used by scm model when driver initial fail or exit
Clean up i8042 filter, rfkill and cancel delayed work when msi-laptop driver initial fail or exit on MSI scm model. Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
-rw-r--r--drivers/platform/x86/msi-laptop.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 5822d0ac68d2..704b5faac599 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -859,6 +859,11 @@ static int __init msi_init(void)
859 859
860fail_platform_device2: 860fail_platform_device2:
861 861
862 if (load_scm_model) {
863 i8042_remove_filter(msi_laptop_i8042_filter);
864 cancel_delayed_work_sync(&msi_rfkill_work);
865 rfkill_cleanup();
866 }
862 platform_device_del(msipf_device); 867 platform_device_del(msipf_device);
863 868
864fail_platform_device1: 869fail_platform_device1:
@@ -878,6 +883,11 @@ fail_backlight:
878 883
879static void __exit msi_cleanup(void) 884static void __exit msi_cleanup(void)
880{ 885{
886 if (load_scm_model) {
887 i8042_remove_filter(msi_laptop_i8042_filter);
888 cancel_delayed_work_sync(&msi_rfkill_work);
889 rfkill_cleanup();
890 }
881 891
882 sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group); 892 sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
883 if (!old_ec_model && threeg_exists) 893 if (!old_ec_model && threeg_exists)
@@ -886,9 +896,6 @@ static void __exit msi_cleanup(void)
886 platform_driver_unregister(&msipf_driver); 896 platform_driver_unregister(&msipf_driver);
887 backlight_device_unregister(msibl_device); 897 backlight_device_unregister(msibl_device);
888 898
889 i8042_remove_filter(msi_laptop_i8042_filter);
890 rfkill_cleanup();
891
892 /* Enable automatic brightness control again */ 899 /* Enable automatic brightness control again */
893 if (auto_brightness != 2) 900 if (auto_brightness != 2)
894 set_auto_brightness(1); 901 set_auto_brightness(1);