aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Kucheria <amit.kucheria@linaro.org>2018-07-26 06:33:08 -0400
committerEduardo Valentin <edubezval@gmail.com>2018-07-27 18:14:21 -0400
commite0fe01426c50f54d06b6ff69de2be536ec0a3256 (patch)
treefe125794aba3028c9767c91aacf542acc3b7c7e4
parent191dc74bad60e1462094b2e25321479e7eb17cdc (diff)
thermal: tsens: Rename variable
We're actually reading the temperature from the status register. Fix the variable name to reflect that. Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org> Reviewed-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/qcom/tsens-common.c6
-rw-r--r--drivers/thermal/qcom/tsens-v2.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c
index c22dc18c7c65..25e7f247b027 100644
--- a/drivers/thermal/qcom/tsens-common.c
+++ b/drivers/thermal/qcom/tsens-common.c
@@ -104,11 +104,11 @@ int get_temp_common(struct tsens_device *tmdev, int id, int *temp)
104{ 104{
105 struct tsens_sensor *s = &tmdev->sensor[id]; 105 struct tsens_sensor *s = &tmdev->sensor[id];
106 u32 code; 106 u32 code;
107 unsigned int sensor_addr; 107 unsigned int status_reg;
108 int last_temp = 0, ret; 108 int last_temp = 0, ret;
109 109
110 sensor_addr = S0_ST_ADDR + s->hw_id * SN_ADDR_OFFSET; 110 status_reg = S0_ST_ADDR + s->hw_id * SN_ADDR_OFFSET;
111 ret = regmap_read(tmdev->map, sensor_addr, &code); 111 ret = regmap_read(tmdev->map, status_reg, &code);
112 if (ret) 112 if (ret)
113 return ret; 113 return ret;
114 last_temp = code & SN_ST_TEMP_MASK; 114 last_temp = code & SN_ST_TEMP_MASK;
diff --git a/drivers/thermal/qcom/tsens-v2.c b/drivers/thermal/qcom/tsens-v2.c
index f40150fd7eae..908e3dcb2d5c 100644
--- a/drivers/thermal/qcom/tsens-v2.c
+++ b/drivers/thermal/qcom/tsens-v2.c
@@ -16,11 +16,11 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp)
16{ 16{
17 struct tsens_sensor *s = &tmdev->sensor[id]; 17 struct tsens_sensor *s = &tmdev->sensor[id];
18 u32 code; 18 u32 code;
19 unsigned int sensor_addr; 19 unsigned int status_reg;
20 int last_temp = 0, last_temp2 = 0, last_temp3 = 0, ret; 20 int last_temp = 0, last_temp2 = 0, last_temp3 = 0, ret;
21 21
22 sensor_addr = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * 4; 22 status_reg = tmdev->tm_offset + STATUS_OFFSET + s->hw_id * 4;
23 ret = regmap_read(tmdev->map, sensor_addr, &code); 23 ret = regmap_read(tmdev->map, status_reg, &code);
24 if (ret) 24 if (ret)
25 return ret; 25 return ret;
26 last_temp = code & LAST_TEMP_MASK; 26 last_temp = code & LAST_TEMP_MASK;
@@ -28,7 +28,7 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp)
28 goto done; 28 goto done;
29 29
30 /* Try a second time */ 30 /* Try a second time */
31 ret = regmap_read(tmdev->map, sensor_addr, &code); 31 ret = regmap_read(tmdev->map, status_reg, &code);
32 if (ret) 32 if (ret)
33 return ret; 33 return ret;
34 if (code & STATUS_VALID_BIT) { 34 if (code & STATUS_VALID_BIT) {
@@ -39,7 +39,7 @@ static int get_temp_tsens_v2(struct tsens_device *tmdev, int id, int *temp)
39 } 39 }
40 40
41 /* Try a third/last time */ 41 /* Try a third/last time */
42 ret = regmap_read(tmdev->map, sensor_addr, &code); 42 ret = regmap_read(tmdev->map, status_reg, &code);
43 if (ret) 43 if (ret)
44 return ret; 44 return ret;
45 if (code & STATUS_VALID_BIT) { 45 if (code & STATUS_VALID_BIT) {