[1/3] thermal/drivers/tsens: Add error/debug prints to calibration read
Commit Message
Add in some dev_dbg() to aid in viewing of raw calibration data extracted.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/thermal/qcom/tsens.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
Comments
On 06/04/2023 17:58, Bryan O'Donoghue wrote:
> Add in some dev_dbg() to aid in viewing of raw calibration data extracted.
>
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> drivers/thermal/qcom/tsens.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
@@ -115,8 +115,12 @@ int tsens_read_calibration(struct tsens_priv *priv, int shift, u32 *p1, u32 *p2,
return ret;
ret = nvmem_cell_read_variable_le_u32(priv->dev, name, &p1[i]);
- if (ret)
+ if (ret) {
+ dev_err(priv->dev, "Failed to read %s\n", name);
return ret;
+ }
+
+ dev_dbg(priv->dev, "%s 0x%x\n", name, p1[i]);
ret = snprintf(name, sizeof(name), "s%d_p2%s", priv->sensor[i].hw_id,
backup ? "_backup" : "");
@@ -124,8 +128,12 @@ int tsens_read_calibration(struct tsens_priv *priv, int shift, u32 *p1, u32 *p2,
return ret;
ret = nvmem_cell_read_variable_le_u32(priv->dev, name, &p2[i]);
- if (ret)
+ if (ret) {
+ dev_err(priv->dev, "Failed to read %s\n", name);
return ret;
+ }
+
+ dev_dbg(priv->dev, "%s 0x%x\n", name, p2[i]);
}
switch (mode) {