Commit de48d876 authored by Christian Marangi's avatar Christian Marangi Committed by Daniel Lezcano

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: default avatarChristian Marangi <ansuelsmth@gmail.com>
Acked-by: default avatarThara Gopinath <thara.gopinath@linaro.org>
Link: https://lore.kernel.org/r/20221022125657.22530-2-ansuelsmth@gmail.comSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@kernel.org>
parent 6840455d
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment