OSDN Git Service

kernel: bump 5.15 to 5.15.32
[immortalwrt/immortalwrt.git] / target / linux / ipq806x / patches-5.15 / 107-1-thermal-qcom-tsens-init-debugfs-only-with-successful.patch
1 From 8f32d48a309246a80bdca505968085a484d54408 Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Mon, 19 Apr 2021 03:01:53 +0200
4 Subject: [thermal-next PATCH v2 1/2] thermal: 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: Ansuel Smith <ansuelsmth@gmail.com>
12 Acked-by: Thara Gopinath <thara.gopinath@linaro.org>
13 ---
14  drivers/thermal/qcom/tsens.c | 9 ++++++---
15  1 file changed, 6 insertions(+), 3 deletions(-)
16
17 --- a/drivers/thermal/qcom/tsens.c
18 +++ b/drivers/thermal/qcom/tsens.c
19 @@ -917,8 +917,6 @@ int __init init_common(struct tsens_priv
20         if (tsens_version(priv) >= VER_0_1)
21                 tsens_enable_irq(priv);
22  
23 -       tsens_debug_init(op);
24 -
25  err_put_device:
26         put_device(&op->dev);
27         return ret;
28 @@ -1157,7 +1155,12 @@ static int tsens_probe(struct platform_d
29                 }
30         }
31  
32 -       return tsens_register(priv);
33 +       ret = tsens_register(priv);
34 +
35 +       if (!ret)
36 +               tsens_debug_init(pdev);
37 +
38 +       return ret;
39  }
40  
41  static int tsens_remove(struct platform_device *pdev)