76df0f56813a92a9adfdcb254324b86cd033ca4a
[openwrt/staging/neocturne.git] /
1 From de48d8766afcd97d147699aaff78a338081c9973 Mon Sep 17 00:00:00 2001
2 From: Christian Marangi <ansuelsmth@gmail.com>
3 Date: Sat, 22 Oct 2022 14:56:55 +0200
4 Subject: [PATCH 1/3] thermal/drivers/qcom/tsens: Init debugfs only with
5 successful probe
6
7 Calibrate and tsens_register can fail or PROBE_DEFER. This will cause a
8 double or a wrong init of the debugfs information. Init debugfs only
9 with successful probe fixing warning about directory already present.
10
11 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
12 Acked-by: Thara Gopinath <thara.gopinath@linaro.org>
13 Link: https://lore.kernel.org/r/20221022125657.22530-2-ansuelsmth@gmail.com
14 Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
15 ---
16 drivers/thermal/qcom/tsens.c | 8 +++++---
17 1 file changed, 5 insertions(+), 3 deletions(-)
18
19 --- a/drivers/thermal/qcom/tsens.c
20 +++ b/drivers/thermal/qcom/tsens.c
21 @@ -918,8 +918,6 @@ int __init init_common(struct tsens_priv
22 if (tsens_version(priv) >= VER_0_1)
23 tsens_enable_irq(priv);
24
25 - tsens_debug_init(op);
26 -
27 err_put_device:
28 put_device(&op->dev);
29 return ret;
30 @@ -1156,7 +1154,11 @@ static int tsens_probe(struct platform_d
31 }
32 }
33
34 - return tsens_register(priv);
35 + ret = tsens_register(priv);
36 + if (!ret)
37 + tsens_debug_init(pdev);
38 +
39 + return ret;
40 }
41
42 static int tsens_remove(struct platform_device *pdev)