From patchwork Thu Sep 13 09:13:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10599055 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1B4514E0 for ; Thu, 13 Sep 2018 09:18:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A09732A2FA for ; Thu, 13 Sep 2018 09:18:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92CE82A308; Thu, 13 Sep 2018 09:18:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A7B32A2FA for ; Thu, 13 Sep 2018 09:18:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726985AbeIMO0n (ORCPT ); Thu, 13 Sep 2018 10:26:43 -0400 Received: from mail-eopbgr70074.outbound.protection.outlook.com ([40.107.7.74]:31552 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727009AbeIMO0m (ORCPT ); Thu, 13 Sep 2018 10:26:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1TkXQqCl9I/ZIB1IPB06ZODzOBj5IFZ3ERn5Mtyoeok=; b=oIPqJftEU3zn07IdBvEOlkc3RGan8BVXnQx58pDcKR+CJEAD04KdP1I9AqG3cA/c/JPS3X8HHMYoaR2QT3yKBXev9IYv0VyMKUGgswIFap7MhCj8r801kUpVGR3XNbPIP+h9Pa4Th0V26U/HZQCi9dGy6EBJLbWS/duzLH6EgwU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; Received: from anson-OptiPlex-790.ap.freescale.net (119.31.174.66) by AM0PR0402MB3906.eurprd04.prod.outlook.com (2603:10a6:208:f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Thu, 13 Sep 2018 09:17:47 +0000 From: Anson Huang To: rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] thermal: imx: improve error message Date: Thu, 13 Sep 2018 17:13:05 +0800 Message-Id: <1536829986-23702-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0090.apcprd03.prod.outlook.com (2603:1096:203:72::30) To AM0PR0402MB3906.eurprd04.prod.outlook.com (2603:10a6:208:f::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2268787-86d1-42e0-cd36-08d61959c679 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR0402MB3906; X-Microsoft-Exchange-Diagnostics: 1;AM0PR0402MB3906;3:hvaBRuJCiyMjfjjBjVQnz2cBnhFEGyR8tKo5eFbu2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LwhVz4W2+eDgEnyYuSb4Id3/+sOV3N1on12Zk7hT4W5Gudh4cJyPtfyOGqLg077TnRdv/Nj9z587MsPaimilDL/+3ikas7vvkn/ssRnIs5htRBxezW5YzejwMHdC84VD1YgGipfoBbQPxQp/mdXJ50rInhjooihvK3NwVzFpOm9EN1c87l3c9NMr40eSQ8zbYFUABo1lvyiloQ145tW67wZVjYfvAiLl39S1N+b8Fsr6i/xPZ7aVcqfAI2qt27vogzmeqbLMbjDfZgmRB1WYHT6z0/3GrCsS3ijUdDZMpK;4:Yqf9A8Olqj8OqtaRUQTVr5Ou8WAl0tRcrGuD5QrLGMBbY2ql/v1cHX5rz6WXd/XVHvpYIu8YDgEFz/R3Aiy+ES101mMV0YcuZlFg1M2m0sBPB5Y+b6XOR8vSK6rektt4kq+Lhl69vNFJtRVUdoK7WsmkQYLvwE5obE7ApQIWdeXpnnrmKKJEg/3DV5V8z/AwdEZfDUMBjwYW4/cz4kQGQksg5ZdQa6JPhIey31mW8qZHsCRTSgxAnDI0tiSE6SRQBcGyhTgsHL3xQe1zYYhs9SjDjYueWpo5W310v4PDCeDHaEaLK+qP3Uj+eA/xfnaG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:AM0PR0402MB3906;BCL:0;PCL:0;RULEID:;SRVR:AM0PR0402MB3906; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(396003)(366004)(39860400002)(376002)(346002)(199004)(189003)(16586007)(2616005)(5660300001)(305945005)(316002)(7736002)(52116002)(106356001)(97736004)(6666003)(2906002)(105586002)(51416003)(6512007)(8676002)(8936002)(50226002)(39060400002)(66066001)(186003)(36756003)(53936002)(81166006)(3846002)(478600001)(6116002)(15650500001)(47776003)(486006)(25786009)(14444005)(81156014)(386003)(6506007)(26005)(16526019)(68736007)(48376002)(6486002)(476003)(956004)(50466002)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR0402MB3906;H:anson-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;AM0PR0402MB3906;23:xiQGdoXrZsWAM6WnYp8mYEGJyLeJpfO9APLBo8BQ3hZ+sZDy4TBgUIohcHXFuDUHPvdsfZ7YAqdZtPG5mPxHnxWrj2e5NDHN6Fg9W2ouN1nBDpJmTMgbsIZs28HD7/NBHj7CIeVtg/fQzmtAVTB/rVquncuG3B1ujCjVyi9l9ool/lT1aDGIAJ/rbK9qqgEvYKFGiFNPZHqWWuC2+8glx1YPxlks4HAZJhgdFNkjB2Akoa42bj1YUvlH+DIa6tjLFQGUvyJGOLAVxIuXyTFXP5pXG66jzySXsxWJ38FYrJvWjdWEmv6VgjHXMWN8DKmjuyHdNDSQ8Exm+kLFh7pGkQpqzRFU8/4g4tSejQZjlo13b4W0Te/94lQbOt2ekObpde88qf7alDTWTTpJY/x4W9+peRko0frkyh6gCmYeqy5EWsU8XGZqD/4oyhoAofVctN0twPtGVtRB8hwa1ndWRibomNmLbSI3qCGaW6uf0qdQ3Qm77JL2MukbD/f5F/vxSbKv4IiGgVf9/roaRPWp7NC+JehRY8pQjO5Gj4JWuqd5oB5REoPtgYABT8zFAHPi7k3Yj+2g0IMrIRDfCS7LCN6/9Zt4h26iOGPeRca67z56bFBAkNcKXY5L/osw6cnyusdbaZW5FgBPMoai0DZOb8t1bhm/88DLdnSbgEi0l9oPw0cKb0EC6G3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63kqIlZM4ps7u0OzrJlfLLJ9GNzrBcp84Nu91goEb+WwvX6d9ERdA5lIfaCdUPyfVYXKqkKlZ2btR8GP8102ugHxQvIauBc+qejqri9vxpiPZyEAET29HMFz1na/uMzxWSnhzpFjZjYsg7iyjMZFsqdQbZvpPBftd92gfHKzMmVLtEVxVo3GF/eEMemUoPNIpvoBu6uBes6ElMX3eJd3E/KBeFxaW/d+ytk6DlPKPWhQbzEufGLPaF9hjFLWARhHs85Kwe/cWIDUdo9QAwQ==;5:v5Y7gZukmREjB5tsVuVvAbTiFXRxKUo9XzAcLCCbdZY/4+X7yNTQnssv23Piv+tLhCF+yz0imi1h7xIn/wa89jmlrhmQIno4/m+lyxABnS6gvWseiVobW1GZAKGnZZ5UgYvM7OgEMTf9iqFdpmkNaIXtJjgDQs7/3HaOgdrz04Y=;7:ZXHZVDye+GaB2XMa5IeAqK5ICrQywkP7PqQvXHEh6y6TXffrg4igrxrFcGQT/xF1mjIvH1TLeDSK0CAIIyYOeNwUu+1Z5GUfCxwF8Ifhz5yjIkSRPongqPQKwkjVtTnkZbUeqjxH1UnZZHsP0NXXGazxKecgfGk1LZsfzp6VfuxDHvLfYA6YZKSI9iTzJkL/b8wh/h0YK3CY+BCzGmbHypIwz1s70jkVG1DmobnwwY1qxCKQ1SMXQQvACqea5wei SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 09:17:47.0243 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d2268787-86d1-42e0-cd36-08d61959c679 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3906 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the duplicated "from" to improve the error message. Signed-off-by: Anson Huang Reviewed-by: Daniel Lezcano --- drivers/thermal/imx_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index aa452ac..6cfa2a8 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -725,7 +725,7 @@ static int imx_thermal_probe(struct platform_device *pdev) } else { ret = imx_init_from_tempmon_data(pdev); if (ret) { - dev_err(&pdev->dev, "failed to init from from fsl,tempmon-data\n"); + dev_err(&pdev->dev, "failed to init from fsl,tempmon-data\n"); return ret; } } From patchwork Thu Sep 13 09:13:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10599053 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 374B814E0 for ; Thu, 13 Sep 2018 09:18:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 26E982A2FA for ; Thu, 13 Sep 2018 09:18:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A6C82A309; Thu, 13 Sep 2018 09:18:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EADAC2A2FA for ; Thu, 13 Sep 2018 09:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728078AbeIMO0q (ORCPT ); Thu, 13 Sep 2018 10:26:46 -0400 Received: from mail-eopbgr70074.outbound.protection.outlook.com ([40.107.7.74]:31552 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726509AbeIMO0o (ORCPT ); Thu, 13 Sep 2018 10:26:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hbBOAhrbqBzQM0KfAcDitE3AaP9j8N8Ylq+iXKGTDg4=; b=poTs8v1mPWMCSPXAv3PtnNIxfmPWaJrKuXSyuHXqXGr39CdkDqg8737sKjq3abdvqOstWNoMDgIONo8z0djZmGiqr513Mi2op78oitzHHMFE8L7wjCmmtCaTGz7zG36gldNv8cL54PJxJWVxdULTYPyAZY9qukfdso6iYB7EK64= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; Received: from anson-OptiPlex-790.ap.freescale.net (119.31.174.66) by AM0PR0402MB3906.eurprd04.prod.outlook.com (2603:10a6:208:f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.16; Thu, 13 Sep 2018 09:17:49 +0000 From: Anson Huang To: rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] thermal: imx: handle error path in one place to save duplicated code Date: Thu, 13 Sep 2018 17:13:06 +0800 Message-Id: <1536829986-23702-2-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536829986-23702-1-git-send-email-Anson.Huang@nxp.com> References: <1536829986-23702-1-git-send-email-Anson.Huang@nxp.com> MIME-Version: 1.0 X-Originating-IP: [119.31.174.66] X-ClientProxiedBy: HK0PR03CA0090.apcprd03.prod.outlook.com (2603:1096:203:72::30) To AM0PR0402MB3906.eurprd04.prod.outlook.com (2603:10a6:208:f::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cda5ef4d-e1b3-4922-1faf-08d61959c7fc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR0402MB3906; X-Microsoft-Exchange-Diagnostics: 1;AM0PR0402MB3906;3:wro+LL+4GIYUjg6owVzSjXbgJ33QV8HNEBSV2uA6AKVPN0cZmOLJFeKdNxGSidchQofgoFYs79OWAdDAovr2OoYj7SadI8YtoRARACnsGZTlUvIp9ABIgreH2rMyf/mo3/KujVrMthddPheFbrqy6UIsknrPMXNT/6sx0+K5q96NR4TLvcV1rAqoAEn/PPg+3ANyyfaUd3LVDvLLcs5gJgUqIWXZvRlmcW74PZZjq2H+qUjqrJGXq3bbMiKGYwpt;25:YgTXwOamC2mnXEUTkVxJfOtQKsOz3miKA13O9rzlYx2+JJmNHW+6G+cSG4lPRvWdsTNK3bqLhlxutgrWldoPWOXBySr5kIGLHm0pBbAcpMo4maAjVkzpGxI87ExS5mJj0nhdHHZkxWbJyhLhIO7vmq753Z8nANj9MVh/UoOnPLyBJGroVqpy79GT4buwLfT3ShVDxFXzcfSq9y6oXqxPzzcUUnJtaEE18fIc3dr9JVyzq9AyXddJMN0BX5NT0LuN+mDDVSO3EwVnha65v22CkNxEqltyEKEUMmIRpobpG+TADCuMKIeryefo/qArpZ/8TBhLj7GVKihpaNJ2ZgbZ4g==;31:MxNQfBdP1ZVnMrqXpxa2Hy+yO5Uq4FhldN5Y5TRwNytnoF3O8PaABWNhArByPLAAKnrYYnAKdf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-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050);SRVR:AM0PR0402MB3906;BCL:0;PCL:0;RULEID:;SRVR:AM0PR0402MB3906; X-Forefront-PRVS: 07943272E1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(136003)(396003)(366004)(39860400002)(376002)(346002)(199004)(189003)(16586007)(2616005)(5660300001)(305945005)(316002)(7736002)(52116002)(106356001)(97736004)(6666003)(76176011)(2906002)(105586002)(51416003)(6512007)(8676002)(8936002)(50226002)(39060400002)(66066001)(186003)(36756003)(53936002)(81166006)(3846002)(478600001)(6116002)(47776003)(486006)(25786009)(14444005)(81156014)(386003)(6506007)(26005)(16526019)(68736007)(48376002)(6486002)(11346002)(476003)(956004)(446003)(50466002)(86362001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR0402MB3906;H:anson-OptiPlex-790.ap.freescale.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;AM0PR0402MB3906;23:auWcr3OnYApnkqGgDvgbV9kLTe8hQ884okVEeXh3XcrlDldIMvXBoyRiwD7XVEAxIhag/YWGqDc9wrbzbPKmdfiU9g+/TFEVazln8NrK3gyZjNHWGPlX1PUOrQ3kL/uKZIjpUh/DWgwKsqW8oNEjWXdUIh1YbMGnAojGOcLUTJrbZ6MbhJHQxjCPxsOK/HPN/6llh9ZGblw+RfdQBzelD+Ma7CIgCqaz9MSi1QapbQpA1eJl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+Ivo3wSuk5fxEfx9Ou0OWbAoqWyGh54hAx8PxAsMW8KktmRM+Pd//6OLDpQaGzgHHlFVbzce30814c8GMxv8HKVWa5biey9TqOQZ1DZNAD5fct/T34whVZxthxblwz813O2NAEEW6Rffg+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2018 09:17:49.8983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cda5ef4d-e1b3-4922-1faf-08d61959c7fc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0402MB3906 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP During probe phase, the error path can be handled in one place and use goto method to save many duplicated code. Signed-off-by: Anson Huang Reviewed-by: Daniel Lezcano --- drivers/thermal/imx_thermal.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 6cfa2a8..1566154 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -762,9 +762,7 @@ static int imx_thermal_probe(struct platform_device *pdev) if (ret != -EPROBE_DEFER) dev_err(&pdev->dev, "failed to get thermal clk: %d\n", ret); - cpufreq_cooling_unregister(data->cdev); - cpufreq_cpu_put(data->policy); - return ret; + goto cpufreq_put; } /* @@ -777,9 +775,7 @@ static int imx_thermal_probe(struct platform_device *pdev) ret = clk_prepare_enable(data->thermal_clk); if (ret) { dev_err(&pdev->dev, "failed to enable thermal clk: %d\n", ret); - cpufreq_cooling_unregister(data->cdev); - cpufreq_cpu_put(data->policy); - return ret; + goto cpufreq_put; } data->tz = thermal_zone_device_register("imx_thermal_zone", @@ -792,10 +788,7 @@ static int imx_thermal_probe(struct platform_device *pdev) ret = PTR_ERR(data->tz); dev_err(&pdev->dev, "failed to register thermal zone device %d\n", ret); - clk_disable_unprepare(data->thermal_clk); - cpufreq_cooling_unregister(data->cdev); - cpufreq_cpu_put(data->policy); - return ret; + goto clk_disable; } dev_info(&pdev->dev, "%s CPU temperature grade - max:%dC" @@ -827,14 +820,20 @@ static int imx_thermal_probe(struct platform_device *pdev) 0, "imx_thermal", data); if (ret < 0) { dev_err(&pdev->dev, "failed to request alarm irq: %d\n", ret); - clk_disable_unprepare(data->thermal_clk); - thermal_zone_device_unregister(data->tz); - cpufreq_cooling_unregister(data->cdev); - cpufreq_cpu_put(data->policy); - return ret; + goto thermal_zone_unregister; } return 0; + +thermal_zone_unregister: + thermal_zone_device_unregister(data->tz); +clk_disable: + clk_disable_unprepare(data->thermal_clk); +cpufreq_put: + cpufreq_cooling_unregister(data->cdev); + cpufreq_cpu_put(data->policy); + + return ret; } static int imx_thermal_remove(struct platform_device *pdev)