diff mbox

ACPI: Remove redundant code in the thermal_init()

Message ID 1307692640.15256.79.camel@lantianyu-ws (mailing list archive)
State New, archived
Headers show

Commit Message

lan,Tianyu June 10, 2011, 7:57 a.m. UTC
Thermal_tz_idr, thermal_cdev_idr, thermal_idr_lock and thermal_list_lock 
are only initialized in the thermal_zone_device_register(). The fucntion 
has not been invoked before here. So these variables have not been initialized. 
It doesn't need to destroy them after class_register failed.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
---
 drivers/thermal/thermal_sys.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: linux-2.6/drivers/thermal/thermal_sys.c
===================================================================
--- linux-2.6.orig/drivers/thermal/thermal_sys.c
+++ linux-2.6/drivers/thermal/thermal_sys.c
@@ -1314,12 +1314,9 @@ 
    int result = 0;
 
    result = class_register(&thermal_class);
-   if (result) {
-       idr_destroy(&thermal_tz_idr);
-       idr_destroy(&thermal_cdev_idr);
-       mutex_destroy(&thermal_idr_lock);
-       mutex_destroy(&thermal_list_lock);
-   }   
+   if (result)
+       return result;
+
    result = genetlink_init();
    return result;
 }