004-v6.2-01-thermal-drivers-qcom-tsens-Init-debugfs-only-with-su.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From de48d8766afcd97d147699aaff78a338081c9973 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  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. Calibrate and tsens_register can fail or PROBE_DEFER. This will cause a
  7. double or a wrong init of the debugfs information. Init debugfs only
  8. with successful probe fixing warning about directory already present.
  9. Signed-off-by: Christian Marangi <[email protected]>
  10. Acked-by: Thara Gopinath <[email protected]>
  11. Link: https://lore.kernel.org/r/[email protected]
  12. Signed-off-by: Daniel Lezcano <[email protected]>
  13. ---
  14. drivers/thermal/qcom/tsens.c | 8 +++++---
  15. 1 file changed, 5 insertions(+), 3 deletions(-)
  16. --- a/drivers/thermal/qcom/tsens.c
  17. +++ b/drivers/thermal/qcom/tsens.c
  18. @@ -918,8 +918,6 @@ int __init init_common(struct tsens_priv
  19. if (tsens_version(priv) >= VER_0_1)
  20. tsens_enable_irq(priv);
  21. - tsens_debug_init(op);
  22. -
  23. err_put_device:
  24. put_device(&op->dev);
  25. return ret;
  26. @@ -1156,7 +1154,11 @@ static int tsens_probe(struct platform_d
  27. }
  28. }
  29. - return tsens_register(priv);
  30. + ret = tsens_register(priv);
  31. + if (!ret)
  32. + tsens_debug_init(pdev);
  33. +
  34. + return ret;
  35. }
  36. static int tsens_remove(struct platform_device *pdev)