aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/thermal/hisi_thermal.c4
-rw-r--r--drivers/thermal/thermal_core.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 36d07295f8e3..5e820b541506 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -68,12 +68,12 @@ static inline int _step_to_temp(int step)
68 * Every step equals (1 * 200) / 255 celsius, and finally 68 * Every step equals (1 * 200) / 255 celsius, and finally
69 * need convert to millicelsius. 69 * need convert to millicelsius.
70 */ 70 */
71 return (HISI_TEMP_BASE + (step * 200 / 255)) * 1000; 71 return (HISI_TEMP_BASE * 1000 + (step * 200000 / 255));
72} 72}
73 73
74static inline long _temp_to_step(long temp) 74static inline long _temp_to_step(long temp)
75{ 75{
76 return ((temp / 1000 - HISI_TEMP_BASE) * 255 / 200); 76 return ((temp - HISI_TEMP_BASE * 1000) * 255) / 200000;
77} 77}
78 78
79static long hisi_thermal_get_sensor_temp(struct hisi_thermal_data *data, 79static long hisi_thermal_get_sensor_temp(struct hisi_thermal_data *data,
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index f1db49625555..5133cd1e10b7 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -959,7 +959,7 @@ static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show,
959 struct thermal_zone_device *tz = to_thermal_zone(dev); \ 959 struct thermal_zone_device *tz = to_thermal_zone(dev); \
960 \ 960 \
961 if (tz->tzp) \ 961 if (tz->tzp) \
962 return sprintf(buf, "%u\n", tz->tzp->name); \ 962 return sprintf(buf, "%d\n", tz->tzp->name); \
963 else \ 963 else \
964 return -EIO; \ 964 return -EIO; \
965 } \ 965 } \