From patchwork Wed Nov 21 05:49:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10691987 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 042E05A4 for ; Wed, 21 Nov 2018 05:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E57942B70C for ; Wed, 21 Nov 2018 05:49:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8E962B70E; Wed, 21 Nov 2018 05:49:42 +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 5DB3F2B70C for ; Wed, 21 Nov 2018 05:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726200AbeKUQWm (ORCPT ); Wed, 21 Nov 2018 11:22:42 -0500 Received: from mail-eopbgr130050.outbound.protection.outlook.com ([40.107.13.50]:9946 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726049AbeKUQWl (ORCPT ); Wed, 21 Nov 2018 11:22:41 -0500 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=cnFOQYtZfyPoGmDDLDtESH9FJlQQCSdy5S8e+1Moi2Q=; b=TPb1PPtD8Eq4ENz/VJzoxun8IZKaKMl3jqT0fPi3Y/e1flcIOzS2r0tq6MX/r9r1IGNc28BnQHGhSjYbtSdD46zH4BOOeVVv3/jEAvDD2RQ66EptW78GCD0JREJeCT6tL1Bac9/BUwtkp8TPorPTtbnz43mo+AFr44T09YE442I= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3785.eurprd04.prod.outlook.com (52.134.71.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.25; Wed, 21 Nov 2018 05:49:36 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::e992:8455:42e:7a0b]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::e992:8455:42e:7a0b%2]) with mapi id 15.20.1294.048; Wed, 21 Nov 2018 05:49:36 +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" , "viresh.kumar@linaro.org" , "l.stach@pengutronix.de" CC: dl-linux-imx Subject: [PATCH V5 1/2] thermal: imx: fix for dependency on cpu-freq Thread-Topic: [PATCH V5 1/2] thermal: imx: fix for dependency on cpu-freq Thread-Index: AQHUgV38O18LyIKJEkqTtSxbEeHS4w== Date: Wed, 21 Nov 2018 05:49:36 +0000 Message-ID: <1542779052-29536-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0200.apcprd02.prod.outlook.com (2603:1096:201:20::12) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB3PR0402MB3785;6:y4m7VQBxWaPWWH0uUB27Z09dS9zzwOJ4aUJZMOG7xEQEDeFHrDgCO0ZVe/NS9mJ6ZyA7UKtoHasvrJTM4a7E0e/iGzOt4ww4jmeVfZ1s+/1m94u4RxITD8PvFj92wRKF+P6l+4tAD7DhEZ6M5AkbvFCXsU/4rGQlYJWAj4NZLIwETluT4Pz/Od7OabgQRskxvrVySKWs9uX6q77tgQeXz8rFGIY/Ae0WJVKgX1gGbC3/kSr4fwPkPKRZSKeqd+MjKvo/9UcMdS3O19+Ffs5AmIu8fy2lUksbLJV97ejFvn45aEBkkwJgCtSnxrYJbaeqv/PaYDZb4Lzlk/sKxOvZm8MQHjdI3wy0N4h+2MoXOgjx2l0fuTHdZRUd6cS25QF+0gw1ugFGzwcD4CunSkwmR38CH/yA63c0FQvWJ7emrqaA6WZ6k5Xex85LP0S427NCbYL7Z1FBKeYFhaUoj9AnGA==;5:s/Ux+5DQLn6sT1gggqB647ybgsMYK1AuM/qLcv19rfOvY8Z1Z2TVQJh35BALkkq63g1wy4T0OgOBw+BF4JrmWlGOXRdNQNMFtlO5BPgl/Jk+Iv9Udrja8RxcOh0Ow8SVc9OkjCh2nXzh/2wLztuaxgAkUKyYP9aPfzWzF7h6Fvc=;7:z8NYAnaC/tdSO4Z7c1X/LeaM5av/Wlkw0e0vZdCJQbYUY2tmi2FlyFCMEwPxX+9fZnj2xkygLi+8UnDR+pW1bmz5nJ7yqhr7736VoZM6Xt0qubvSj4D9CaAwrZRlktzgZPpMDXcUpkKRAR5hF9iUIA== x-ms-office365-filtering-correlation-id: d4bee690-ef2f-48b7-fb05-08d64f751e41 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3785; x-ms-traffictypediagnostic: DB3PR0402MB3785: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231442)(944501410)(52105112)(3002001)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:DB3PR0402MB3785;BCL:0;PCL:0;RULEID:;SRVR:DB3PR0402MB3785; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(396003)(346002)(376002)(39860400002)(199004)(189003)(71200400001)(102836004)(486006)(4326008)(256004)(5660300001)(66066001)(8676002)(106356001)(71190400001)(6506007)(6436002)(110136005)(6116002)(316002)(3846002)(26005)(86362001)(386003)(2906002)(476003)(2900100001)(478600001)(2201001)(2616005)(53936002)(81156014)(50226002)(52116002)(39060400002)(99286004)(8936002)(25786009)(81166006)(305945005)(7736002)(2501003)(97736004)(186003)(6486002)(105586002)(14454004)(36756003)(68736007)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3785;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;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-antispam-message-info: WlNeazE01eWxkQMAHQfEQqmyJKNUKLwUdvFUqk5zAXDSneIqKxdBvUlgl8g2lqs0UAK2Gd9/SxFZNHh9b7RK3B5k7s/KR0h39sBx/wOa5WgCEM5TreYw6MebCWfDccLEmzAgVgPvreyCsbHg7H3QpPnxEd6OTQC/imu/PkNIfbLWNTojUUL8WwHo3LHfVJCliZBAisbiEzGFhSaktQhgVEGZeGVDYod4SjBf+CwK+LeA3gZjlUQgP2Yjao26bxCUrL3k4IL5ROL5FlorvoWbHNB5EsQ4QpCOk9rUBVp48pQnd4T3sAB/Q7nhpDaAqoJFGNeuCuu1KGLQcV7rtL94wyxErQu00RP3RiTig3eQZH8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4bee690-ef2f-48b7-fb05-08d64f751e41 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 05:49:36.6869 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3785 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 The thermal driver is a standalone driver for monitoring SoC temperature by enabling thermal sensor, so it can be enabled even when CONFIG_CPU_FREQ is NOT set. So remove the dependency with CPU_THERMAL. Introduce dummy function of legacy cooling register/unregister to make thermal driver probe successfully when CONFIG_CPU_FREQ is NOT set. Signed-off-by: Anson Huang Acked-by: Viresh Kumar Reviewed-by: Daniel Lezcano --- drivers/thermal/Kconfig | 2 +- drivers/thermal/imx_thermal.c | 47 ++++++++++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 5422523..93bd3bb 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -212,7 +212,7 @@ config HISI_THERMAL config IMX_THERMAL tristate "Temperature sensor driver for Freescale i.MX SoCs" - depends on (ARCH_MXC && CPU_THERMAL) || COMPILE_TEST + depends on ARCH_MXC || COMPILE_TEST depends on NVMEM || !NVMEM depends on MFD_SYSCON depends on OF diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 1566154..c924396 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -648,15 +648,24 @@ static const struct of_device_id of_imx_thermal_match[] = { }; MODULE_DEVICE_TABLE(of, of_imx_thermal_match); +#ifdef CONFIG_CPU_FREQ /* * Create cooling device in case no #cooling-cells property is available in * CPU node */ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) { - struct device_node *np = of_get_cpu_node(data->policy->cpu, NULL); + struct device_node *np; int ret; + data->policy = cpufreq_cpu_get(0); + if (!data->policy) { + pr_debug("%s: CPUFreq policy not found\n", __func__); + return -EPROBE_DEFER; + } + + np = of_get_cpu_node(data->policy->cpu, NULL); + if (!np || !of_find_property(np, "#cooling-cells", NULL)) { data->cdev = cpufreq_cooling_register(data->policy); if (IS_ERR(data->cdev)) { @@ -669,6 +678,24 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) return 0; } +static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) +{ + cpufreq_cooling_unregister(data->cdev); + cpufreq_cpu_put(data->policy); +} + +#else + +static inline int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) +{ + return 0; +} + +static inline void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) +{ +} +#endif + static int imx_thermal_probe(struct platform_device *pdev) { struct imx_thermal_data *data; @@ -743,14 +770,11 @@ static int imx_thermal_probe(struct platform_device *pdev) regmap_write(map, data->socdata->sensor_ctrl + REG_SET, data->socdata->power_down_mask); - data->policy = cpufreq_cpu_get(0); - if (!data->policy) { - pr_debug("%s: CPUFreq policy not found\n", __func__); - return -EPROBE_DEFER; - } - ret = imx_thermal_register_legacy_cooling(data); if (ret) { + if (ret == -EPROBE_DEFER) + return ret; + dev_err(&pdev->dev, "failed to register cpufreq cooling device: %d\n", ret); return ret; @@ -762,7 +786,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); - goto cpufreq_put; + goto legacy_cleanup; } /* @@ -775,7 +799,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); - goto cpufreq_put; + goto legacy_cleanup; } data->tz = thermal_zone_device_register("imx_thermal_zone", @@ -829,9 +853,8 @@ static int imx_thermal_probe(struct platform_device *pdev) 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); +legacy_cleanup: + imx_thermal_unregister_legacy_cooling(data); return ret; } From patchwork Wed Nov 21 05:49:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anson Huang X-Patchwork-Id: 10691989 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 5B5FD15A7 for ; Wed, 21 Nov 2018 05:49:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46C472B70C for ; Wed, 21 Nov 2018 05:49:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33C822B70E; Wed, 21 Nov 2018 05:49:52 +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 CD7CA2B70C for ; Wed, 21 Nov 2018 05:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbeKUQWp (ORCPT ); Wed, 21 Nov 2018 11:22:45 -0500 Received: from mail-eopbgr130050.outbound.protection.outlook.com ([40.107.13.50]:9946 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727489AbeKUQWo (ORCPT ); Wed, 21 Nov 2018 11:22:44 -0500 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=sEIlG+G9TYxEGgVWlfraKyTYijC2/R+P12nvQEfS4X0=; b=ccQmcCS+M0oU4sUcJXyixBQBKFVi29FY3wg2kCypDyyTLv5OkD4mpQu7023zs6CMUeE0Jy5wfz6e5rxMsicNxhRdT29cQLjmbMst+b+kprE4TvCZP5ZzMHqNx7ngOynvQSquBKCLyGAHo+DzHP4Lsku95O6fU9CSGF0uv2mWMHc= Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com (52.134.72.18) by DB3PR0402MB3785.eurprd04.prod.outlook.com (52.134.71.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1339.25; Wed, 21 Nov 2018 05:49:40 +0000 Received: from DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::e992:8455:42e:7a0b]) by DB3PR0402MB3916.eurprd04.prod.outlook.com ([fe80::e992:8455:42e:7a0b%2]) with mapi id 15.20.1294.048; Wed, 21 Nov 2018 05:49:40 +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" , "viresh.kumar@linaro.org" , "l.stach@pengutronix.de" CC: dl-linux-imx Subject: [PATCH V5 2/2] thermal: imx: save one condition block for normal case of nvmem initialization Thread-Topic: [PATCH V5 2/2] thermal: imx: save one condition block for normal case of nvmem initialization Thread-Index: AQHUgV3+A7hSKOLYR06aazyOdDuFNw== Date: Wed, 21 Nov 2018 05:49:40 +0000 Message-ID: <1542779052-29536-2-git-send-email-Anson.Huang@nxp.com> References: <1542779052-29536-1-git-send-email-Anson.Huang@nxp.com> In-Reply-To: <1542779052-29536-1-git-send-email-Anson.Huang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK2PR02CA0200.apcprd02.prod.outlook.com (2603:1096:201:20::12) To DB3PR0402MB3916.eurprd04.prod.outlook.com (2603:10a6:8:10::18) authentication-results: spf=none (sender IP is ) smtp.mailfrom=anson.huang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB3PR0402MB3785;6:eDgxysML9aRm/cY96pbqCw1Iyv64wmcdcJfQiITzgbI2SjaxZbaQaS+4Osjju0ewl7l5+Lqiz3vTrd58bLE7MwIj27DDlhrFzPAIa9+Ewhg7WG9pdfnnI2YHBHNR1p0Beqmf4KllANzPMGAM/OJq2T2GfGPQqNJ48TX0xrUcA0Tyb96wL3XgVkC2SXj5yLh2KX0RXEKROn7vIux9n/VRIc8u9GRSVdEnl9XQcQeJ3IZyLBInv5HcsRB0MmlBJcqq0yZXYlokT0tclsHM3Ep977P1NOUgvdrkfZtl65dZ0xPeBzSTQqIGJOF11cb4Qj6+7phRoijnuCGFXy70xeZvlm+obToBeY2ehzyUYVydce6cCCd/21n9cdAq1ZLOj2FftW54zRb+w+GUGU75Uzz9DFXvoYUU7XQTv+Cab8dcqNSXo4AO4SZcfTv/ZEnX89DijNQdwFSGZ9U6cYX2PeMh6g==;5:aWTcLrSKe43yhKpSNW88tEa0rJFScOxF4Lxlb7v2byD1qoFuo7TeFLWcKrTqetTIO/r+N0zKsL4Z6lmav5KaPGVnb55ybVXdgNMdRzqN+VB5ZCLjIN2HesTgtfbeEk1BZ5gLjvkXaRPoA6vC6dtLYeQ0OvM2fuqOYmJBlTSct4w=;7:v15KJ+ftpjYX/j3o4SP+XC3ivZG6GT6hBB7fFp/+9gflHxTrWKQiSVhZYfJ8hBqgss8h6ur5wgHHcoDAkoIFA5Hb03e5W17p6ACKm2baESFlmx0jatJxKBvkkO2YzxwleBp1mAUJk+cutkCNoQrO+Q== x-ms-office365-filtering-correlation-id: 31e77ae1-b876-4ef9-284a-08d64f7520a4 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DB3PR0402MB3785; x-ms-traffictypediagnostic: DB3PR0402MB3785: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231442)(944501410)(52105112)(3002001)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:DB3PR0402MB3785;BCL:0;PCL:0;RULEID:;SRVR:DB3PR0402MB3785; x-forefront-prvs: 08635C03D4 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(136003)(366004)(396003)(346002)(376002)(39860400002)(199004)(189003)(71200400001)(102836004)(486006)(4326008)(256004)(5660300001)(66066001)(8676002)(106356001)(71190400001)(11346002)(6506007)(6436002)(76176011)(110136005)(6116002)(446003)(316002)(3846002)(26005)(86362001)(386003)(2906002)(476003)(2900100001)(478600001)(2201001)(2616005)(53936002)(81156014)(50226002)(52116002)(39060400002)(99286004)(8936002)(25786009)(81166006)(305945005)(7736002)(2501003)(97736004)(186003)(6486002)(105586002)(14454004)(36756003)(68736007)(6512007);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR0402MB3785;H:DB3PR0402MB3916.eurprd04.prod.outlook.com;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-antispam-message-info: uOh0z24v7P1wv6zW1Zev5GRQFCPCIvP5+9cEUBqB/P2fF7XSFSWLhIsvarsNZfpBro2v2HDmGv9fF0bkr7nUKN+CGR7ozAbVrd9LbV+5rfgLG7JJ7t3WUP4k7CI0YpKzu1PPEMbZRsZJiGepsZjuUZ/6E3f5MjnYls6H47RvzOSZ5dDd+QannL+GT6u3JLLCyGr7na/vasdgpPop9SmlJjntE/eKqp2nRXJb3alIq4wXbD80mqVYlJZetu1fseUmL1O43vOeYSgKfbJN+0tCD92F3Awn5QwSJsjcUUVwWupHJFafmvPxMBpZodlMKyxKEncoMBslp8Aw9ldIzVkmFqMnNfvE41XvIS6SLzINcfI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31e77ae1-b876-4ef9-284a-08d64f7520a4 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2018 05:49:40.1023 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3785 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 Put return value checks of calling imx_init_from_nvmem_cells() into one block to save one condition block for normal case. Signed-off-by: Anson Huang Acked-by: Viresh Kumar Reviewed-by: Daniel Lezcano --- drivers/thermal/imx_thermal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index c924396..bb6754a 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -742,9 +742,10 @@ static int imx_thermal_probe(struct platform_device *pdev) if (of_find_property(pdev->dev.of_node, "nvmem-cells", NULL)) { ret = imx_init_from_nvmem_cells(pdev); - if (ret == -EPROBE_DEFER) - return ret; if (ret) { + if (ret == -EPROBE_DEFER) + return ret; + dev_err(&pdev->dev, "failed to init from nvmem: %d\n", ret); return ret;