e3ffb330f5b7c6ca03d314fa209aabbd74b33068
[openwrt/openwrt.git] / target / linux / mediatek / patches / 0015-thermal-inline-only-once-used-function.patch
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
5
6 Inline update_temperature into its only caller to make the code
7 more readable.
8
9 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
10 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
11 ---
12 drivers/thermal/thermal_core.c | 17 +++++------------
13 1 file changed, 5 insertions(+), 12 deletions(-)
14
15 --- a/drivers/thermal/thermal_core.c
16 +++ b/drivers/thermal/thermal_core.c
17 @@ -450,9 +450,12 @@ exit:
18 }
19 EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
20
21 -static void update_temperature(struct thermal_zone_device *tz)
22 +void thermal_zone_device_update(struct thermal_zone_device *tz)
23 {
24 - int temp, ret;
25 + int temp, ret, count;
26 +
27 + if (!tz->ops->get_temp)
28 + return;
29
30 ret = thermal_zone_get_temp(tz, &temp);
31 if (ret) {
32 @@ -471,16 +474,6 @@ static void update_temperature(struct th
33 trace_thermal_temperature(tz);
34 dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
35 tz->last_temperature, tz->temperature);
36 -}
37 -
38 -void thermal_zone_device_update(struct thermal_zone_device *tz)
39 -{
40 - int count;
41 -
42 - if (!tz->ops->get_temp)
43 - return;
44 -
45 - update_temperature(tz);
46
47 for (count = 0; count < tz->trips; count++)
48 handle_thermal_trip(tz, count);