Skip to content

Commit de48d87

Browse files
AnsuelDaniel Lezcano
authored andcommitted
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>
1 parent 6840455 commit de48d87

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/thermal/qcom/tsens.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,6 @@ int __init init_common(struct tsens_priv *priv)
939939
if (tsens_version(priv) >= VER_0_1)
940940
tsens_enable_irq(priv);
941941

942-
tsens_debug_init(op);
943-
944942
err_put_device:
945943
put_device(&op->dev);
946944
return ret;
@@ -1182,7 +1180,11 @@ static int tsens_probe(struct platform_device *pdev)
11821180
}
11831181
}
11841182

1185-
return tsens_register(priv);
1183+
ret = tsens_register(priv);
1184+
if (!ret)
1185+
tsens_debug_init(pdev);
1186+
1187+
return ret;
11861188
}
11871189

11881190
static int tsens_remove(struct platform_device *pdev)

0 commit comments

Comments
 (0)