ACPI: thinkpad-acpi: duplicate driver attributes to new hwmon pdrv
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sun, 23 Sep 2007 14:39:07 +0000 (11:39 -0300)
committerLen Brown <len.brown@intel.com>
Tue, 25 Sep 2007 19:22:07 +0000 (15:22 -0400)
Thinkpad-acpi has some driver attributes (debug level, sysfs interface
version, etc) that also belong to the new hwmon driver.  Duplicate them
there.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.h

index d5fb93ed04f03a9929c0147c2fa5e4faa2d08bb7..81693b4c23b861a0b51947a8e58036f6c26eaf45 100644 (file)
@@ -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);
 
index 791b8ca4bca58b80d22066d6d61d1ea0e3fb6629..c5fdd688cc990c3752e451df5de403797c4f4103 100644 (file)
@@ -252,6 +252,7 @@ static struct {
        u32 platform_drv_registered:1;
        u32 platform_drv_attrs_registered:1;
        u32 sensors_pdrv_registered:1;
+       u32 sensors_pdrv_attrs_registered:1;
        u32 sensors_pdev_attrs_registered:1;
 } tp_features;