diff options
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
| -rw-r--r-- | drivers/misc/thinkpad_acpi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index fa80f355e522..f6cd34a3dbac 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
| @@ -4668,12 +4668,15 @@ static int __init thinkpad_acpi_module_init(void) | |||
| 4668 | thinkpad_acpi_module_exit(); | 4668 | thinkpad_acpi_module_exit(); |
| 4669 | return ret; | 4669 | return ret; |
| 4670 | } | 4670 | } |
| 4671 | tp_features.platform_drv_registered = 1; | ||
| 4672 | |||
| 4671 | ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); | 4673 | ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); |
| 4672 | if (ret) { | 4674 | if (ret) { |
| 4673 | printk(IBM_ERR "unable to create sysfs driver attributes\n"); | 4675 | printk(IBM_ERR "unable to create sysfs driver attributes\n"); |
| 4674 | thinkpad_acpi_module_exit(); | 4676 | thinkpad_acpi_module_exit(); |
| 4675 | return ret; | 4677 | return ret; |
| 4676 | } | 4678 | } |
| 4679 | tp_features.platform_drv_attrs_registered = 1; | ||
| 4677 | 4680 | ||
| 4678 | 4681 | ||
| 4679 | /* Device initialization */ | 4682 | /* Device initialization */ |
| @@ -4756,8 +4759,11 @@ static void thinkpad_acpi_module_exit(void) | |||
| 4756 | if (tpacpi_pdev) | 4759 | if (tpacpi_pdev) |
| 4757 | platform_device_unregister(tpacpi_pdev); | 4760 | platform_device_unregister(tpacpi_pdev); |
| 4758 | 4761 | ||
| 4759 | tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); | 4762 | if (tp_features.platform_drv_attrs_registered) |
| 4760 | platform_driver_unregister(&tpacpi_pdriver); | 4763 | tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); |
| 4764 | |||
| 4765 | if (tp_features.platform_drv_registered) | ||
| 4766 | platform_driver_unregister(&tpacpi_pdriver); | ||
| 4761 | 4767 | ||
| 4762 | if (proc_dir) | 4768 | if (proc_dir) |
| 4763 | remove_proc_entry(IBM_PROC_DIR, acpi_root_dir); | 4769 | remove_proc_entry(IBM_PROC_DIR, acpi_root_dir); |
