diff options
Diffstat (limited to 'drivers/misc/thinkpad_acpi.c')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index d5fb93ed04f0..81693b4c23b8 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c | |||
@@ -4803,12 +4803,16 @@ static int __init thinkpad_acpi_module_init(void) | |||
4803 | tp_features.sensors_pdrv_registered = 1; | 4803 | tp_features.sensors_pdrv_registered = 1; |
4804 | 4804 | ||
4805 | ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); | 4805 | ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver); |
4806 | if (!ret) { | ||
4807 | tp_features.platform_drv_attrs_registered = 1; | ||
4808 | ret = tpacpi_create_driver_attributes(&tpacpi_hwmon_pdriver.driver); | ||
4809 | } | ||
4806 | if (ret) { | 4810 | if (ret) { |
4807 | printk(IBM_ERR "unable to create sysfs driver attributes\n"); | 4811 | printk(IBM_ERR "unable to create sysfs driver attributes\n"); |
4808 | thinkpad_acpi_module_exit(); | 4812 | thinkpad_acpi_module_exit(); |
4809 | return ret; | 4813 | return ret; |
4810 | } | 4814 | } |
4811 | tp_features.platform_drv_attrs_registered = 1; | 4815 | tp_features.sensors_pdrv_attrs_registered = 1; |
4812 | 4816 | ||
4813 | 4817 | ||
4814 | /* Device initialization */ | 4818 | /* Device initialization */ |
@@ -4919,6 +4923,8 @@ static void thinkpad_acpi_module_exit(void) | |||
4919 | if (tpacpi_pdev) | 4923 | if (tpacpi_pdev) |
4920 | platform_device_unregister(tpacpi_pdev); | 4924 | platform_device_unregister(tpacpi_pdev); |
4921 | 4925 | ||
4926 | if (tp_features.sensors_pdrv_attrs_registered) | ||
4927 | tpacpi_remove_driver_attributes(&tpacpi_hwmon_pdriver.driver); | ||
4922 | if (tp_features.platform_drv_attrs_registered) | 4928 | if (tp_features.platform_drv_attrs_registered) |
4923 | tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); | 4929 | tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver); |
4924 | 4930 | ||