Path: csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Krzysztof Kozlowski Newsgroups: linux.kernel Subject: [PATCH] thermal: exynos: Disable the regulator on probe failure Date: Mon, 08 Jun 2015 03:40:01 +0200 Message-ID: X-Original-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 X-Auditid: cbfec7f4-f79c56d0000012ee-49-5574f184561d 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: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 44 Organization: linux.* mail to news gateway X-Original-Cc: stable@vger.kernel.org X-Original-Date: Mon, 08 Jun 2015 10:35:49 +0900 X-Original-Message-ID: <1433727349-23330-1-git-send-email-k.kozlowski@samsung.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: aioe.org linux.kernel:1160202 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/