summaryrefslogtreecommitdiff
path: root/drivers/thermal/qcom/tsens.c
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-10-22 14:56:55 +0200
committerDaniel Lezcano <daniel.lezcano@kernel.org>2022-12-14 15:25:40 +0100
commitde48d8766afcd97d147699aaff78a338081c9973 (patch)
treef55f0bdf206aa24848cf6d8c2263332ac5df884a /drivers/thermal/qcom/tsens.c
parent6840455debd38ea82b1f9fbbf8019944da36f7eb (diff)
thermal/drivers/qcom/tsens: Init debugfs only with successful probe
Calibrate and tsens_register can fail or PROBE_DEFER. This will cause a double or a wrong init of the debugfs information. Init debugfs only with successful probe fixing warning about directory already present. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Acked-by: Thara Gopinath <thara.gopinath@linaro.org> Link: https://lore.kernel.org/r/20221022125657.22530-2-ansuelsmth@gmail.com Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Diffstat (limited to 'drivers/thermal/qcom/tsens.c')
-rw-r--r--drivers/thermal/qcom/tsens.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index b7d978295b2f..3ac780404c72 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -939,8 +939,6 @@ int __init init_common(struct tsens_priv *priv)
if (tsens_version(priv) >= VER_0_1)
tsens_enable_irq(priv);
- tsens_debug_init(op);
-
err_put_device:
put_device(&op->dev);
return ret;
@@ -1182,7 +1180,11 @@ static int tsens_probe(struct platform_device *pdev)
}
}
- return tsens_register(priv);
+ ret = tsens_register(priv);
+ if (!ret)
+ tsens_debug_init(pdev);
+
+ return ret;
}
static int tsens_remove(struct platform_device *pdev)