mediatek: add support for the new MT7623 Arm SoC
[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 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
16 index e204deb..19da022 100644
17 --- a/drivers/thermal/thermal_core.c
18 +++ b/drivers/thermal/thermal_core.c
19 @@ -450,9 +450,12 @@ exit:
20  }
21  EXPORT_SYMBOL_GPL(thermal_zone_get_temp);
22  
23 -static void update_temperature(struct thermal_zone_device *tz)
24 +void thermal_zone_device_update(struct thermal_zone_device *tz)
25  {
26 -       int temp, ret;
27 +       int temp, ret, count;
28 +
29 +       if (!tz->ops->get_temp)
30 +               return;
31  
32         ret = thermal_zone_get_temp(tz, &temp);
33         if (ret) {
34 @@ -471,16 +474,6 @@ static void update_temperature(struct thermal_zone_device *tz)
35         trace_thermal_temperature(tz);
36         dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
37                                 tz->last_temperature, tz->temperature);
38 -}
39 -
40 -void thermal_zone_device_update(struct thermal_zone_device *tz)
41 -{
42 -       int count;
43 -
44 -       if (!tz->ops->get_temp)
45 -               return;
46 -
47 -       update_temperature(tz);
48  
49         for (count = 0; count < tz->trips; count++)
50                 handle_thermal_trip(tz, count);
51 -- 
52 1.7.10.4
53