1 From 0b729a98127ef045096edf20dfe5c4eadac21d44 Mon Sep 17 00:00:00 2001
2 From: Sascha Hauer <s.hauer@pengutronix.de>
3 Date: Wed, 13 May 2015 10:52:34 +0200
4 Subject: [PATCH 15/76] thermal: inline only once used function
6 Inline update_temperature into its only caller to make the code
9 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
10 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
12 drivers/thermal/thermal_core.c | 17 +++++------------
13 1 file changed, 5 insertions(+), 12 deletions(-)
15 --- a/drivers/thermal/thermal_core.c
16 +++ b/drivers/thermal/thermal_core.c
17 @@ -453,9 +453,15 @@ exit:
19 EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
21 -static void update_temperature(struct thermal_zone_device *tz)
22 +void thermal_zone_device_update(struct thermal_zone_device *tz)
25 + int temp, ret, count;
27 + if (atomic_read(&in_suspend))
30 + if (!tz->ops->get_temp)
33 ret = thermal_zone_get_temp(tz, &temp);
35 @@ -478,7 +484,11 @@ static void update_temperature(struct th
37 dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
38 tz->last_temperature, tz->temperature);
40 + for (count = 0; count < tz->trips; count++)
41 + handle_thermal_trip(tz, count);
43 +EXPORT_SYMBOL_GPL(thermal_zone_device_update);
45 static void thermal_zone_device_reset(struct thermal_zone_device *tz)
47 @@ -490,23 +500,6 @@ static void thermal_zone_device_reset(st
48 pos->initialized = false;
51 -void thermal_zone_device_update(struct thermal_zone_device *tz)
55 - if (atomic_read(&in_suspend))
58 - if (!tz->ops->get_temp)
61 - update_temperature(tz);
63 - for (count = 0; count < tz->trips; count++)
64 - handle_thermal_trip(tz, count);
66 -EXPORT_SYMBOL_GPL(thermal_zone_device_update);
68 static void thermal_zone_device_check(struct work_struct *work)
70 struct thermal_zone_device *tz = container_of(work, struct