[PATCH 1/3] thermal/drivers/tsens: Add error/debug prints to calibration read

From: Bryan O'Donoghue
Date: Thu Apr 06 2023 - 10:59:05 EST


Add in some dev_dbg() to aid in viewing of raw calibration data extracted.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
---
drivers/thermal/qcom/tsens.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c
index d3218127e617d..7165b0bfe8b9f 100644
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -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) {
--
2.39.2