|
@@ -4803,12 +4803,16 @@ static int __init thinkpad_acpi_module_init(void)
|
|
|
tp_features.sensors_pdrv_registered = 1;
|
|
|
|
|
|
ret = tpacpi_create_driver_attributes(&tpacpi_pdriver.driver);
|
|
|
+ if (!ret) {
|
|
|
+ tp_features.platform_drv_attrs_registered = 1;
|
|
|
+ ret = tpacpi_create_driver_attributes(&tpacpi_hwmon_pdriver.driver);
|
|
|
+ }
|
|
|
if (ret) {
|
|
|
printk(IBM_ERR "unable to create sysfs driver attributes\n");
|
|
|
thinkpad_acpi_module_exit();
|
|
|
return ret;
|
|
|
}
|
|
|
- tp_features.platform_drv_attrs_registered = 1;
|
|
|
+ tp_features.sensors_pdrv_attrs_registered = 1;
|
|
|
|
|
|
|
|
|
/* Device initialization */
|
|
@@ -4919,6 +4923,8 @@ static void thinkpad_acpi_module_exit(void)
|
|
|
if (tpacpi_pdev)
|
|
|
platform_device_unregister(tpacpi_pdev);
|
|
|
|
|
|
+ if (tp_features.sensors_pdrv_attrs_registered)
|
|
|
+ tpacpi_remove_driver_attributes(&tpacpi_hwmon_pdriver.driver);
|
|
|
if (tp_features.platform_drv_attrs_registered)
|
|
|
tpacpi_remove_driver_attributes(&tpacpi_pdriver.driver);
|
|
|
|