diff mbox series

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

Message ID 20230406145850.357296-2-bryan.odonoghue@linaro.org (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series drivers/thermal/qcom/tsens: Add ability to read and shift-in non-contiguous calibration data | expand

Commit Message

Bryan O'Donoghue April 6, 2023, 2:58 p.m. UTC
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

Dmitry Baryshkov April 6, 2023, 5:36 p.m. UTC | #1
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>
diff mbox series

Patch

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) {