Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751790AbbFHBgT (ORCPT ); Sun, 7 Jun 2015 21:36:19 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:27622 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750872AbbFHBgI (ORCPT ); Sun, 7 Jun 2015 21:36:08 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-49-5574f184561d From: Krzysztof Kozlowski To: Lukasz Majewski , Zhang Rui , Eduardo Valentin , Kukjin Kim , Krzysztof Kozlowski , linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH] thermal: exynos: Disable the regulator on probe failure Date: Mon, 08 Jun 2015 10:35:49 +0900 Message-id: <1433727349-23330-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e/4Nd3WjyWhBivyLOZfucZq8fqFoUX/ 49fMFm8ebma02PQYKHR51xw2i8+9RxgtZpzfx2Tx5GEfm8WCjY8YHbg8ds66y+6xeM9LJo9N qzrZPDYvqffo27KK0ePzJrkAtigum5TUnMyy1CJ9uwSujMa1p5gLWrkr5lxbz9bAuJyzi5GD Q0LAROLoO+EuRk4gU0ziwr31bF2MXBxCAksZJWZOWMEO4fxnlDg3bQsTSBWbgLHE5uVLwKpE BM4wSZzs2MoIkmAWkJJY9+kQG4gtLOAhsf/1GTCbRUBVYunBB+wgNq+Au8SG3TfZIdbJSZw8 Npl1AiP3AkaGVYyiqaXJBcVJ6bmGesWJucWleel6yfm5mxghgfRlB+PiY1aHGAU4GJV4eA8s KgkVYk0sK67MPcQowcGsJMJ79z5QiDclsbIqtSg/vqg0J7X4EKM0B4uSOO/cXe9DhATSE0tS s1NTC1KLYLJMHJxSDYzzezkXsdhMDFLiFCnRd1n4UGXrvwn8LwUnmkzMeSm84MmCpx18M52c kxw8uA7np0l4Fh1sDy1Lm90xYV7E8/dnT0lLSyiHPM6I3r1hosVXE/830xas+DNf5U3urLP/ brqrPN5wZpvfmwN+Gzl+25VPaHhc+T1KYtas1RJWdvp7626U+DP/fZSuxFKckWioxVxUnAgA bdaCWCACAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1619 Lines: 44 During probe the regulator (if present) was enabled but not disabled in case of failure. So an unsuccessful probe lead to enabling the regulator which was actually not needed because the device was not enabled. Additionally each deferred probe lead to increase of regulator enable count so it would not be effectively disabled during removal of the device. Signed-off-by: Krzysztof Kozlowski Fixes: 498d22f616f6 ("thermal: exynos: Support for TMU regulator defined at device tree") Cc: --- I am not entirely convinced that this should go to stable. Leaving a regulator enabled in case of probe failure (no exynos TMU device) or after deferred probe (regulator won't be disabled during device removal) is not a critical issue, just leaks power. --- drivers/thermal/samsung/exynos_tmu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 531f4b179871..13c3aceed19d 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1392,6 +1392,8 @@ err_clk_sec: if (!IS_ERR(data->clk_sec)) clk_unprepare(data->clk_sec); err_sensor: + if (!IS_ERR_OR_NULL(data->regulator)) + regulator_disable(data->regulator); thermal_zone_of_sensor_unregister(&pdev->dev, data->tzd); return ret; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/