From patchwork Fri Jun 10 07:57:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 868062 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p5A86KDX010476 for ; Fri, 10 Jun 2011 08:06:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753492Ab1FJIGS (ORCPT ); Fri, 10 Jun 2011 04:06:18 -0400 Received: from mga02.intel.com ([134.134.136.20]:55495 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071Ab1FJIGQ (ORCPT ); Fri, 10 Jun 2011 04:06:16 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 10 Jun 2011 01:06:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.65,345,1304319600"; d="scan'208";a="12552685" Received: from lantianyu-ws.sh.intel.com (HELO [10.239.35.77]) ([10.239.35.77]) by orsmga001.jf.intel.com with ESMTP; 10 Jun 2011 01:06:15 -0700 Subject: [PATCH] ACPI: Remove redundant code in the thermal_init() From: "lan,Tianyu" To: len.brown@intel.com Cc: linux-acpi@vger.kernel.org Date: Fri, 10 Jun 2011 15:57:20 +0800 Message-ID: <1307692640.15256.79.camel@lantianyu-ws> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 10 Jun 2011 08:06:20 +0000 (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 --- 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 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; }