generic/4.4: remove ISSI SI25CD512 SPI flash support patch
[openwrt/svn-archive/archive.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 @@ -453,9 +453,15 @@ 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 (atomic_read(&in_suspend))
28 + return;
29 +
30 + if (!tz->ops->get_temp)
31 + return;
32
33 ret = thermal_zone_get_temp(tz, &temp);
34 if (ret) {
35 @@ -478,7 +484,11 @@ static void update_temperature(struct th
36 else
37 dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
38 tz->last_temperature, tz->temperature);
39 +
40 + for (count = 0; count < tz->trips; count++)
41 + handle_thermal_trip(tz, count);
42 }
43 +EXPORT_SYMBOL_GPL(thermal_zone_device_update);
44
45 static void thermal_zone_device_reset(struct thermal_zone_device *tz)
46 {
47 @@ -490,23 +500,6 @@ static void thermal_zone_device_reset(st
48 pos->initialized = false;
49 }
50
51 -void thermal_zone_device_update(struct thermal_zone_device *tz)
52 -{
53 - int count;
54 -
55 - if (atomic_read(&in_suspend))
56 - return;
57 -
58 - if (!tz->ops->get_temp)
59 - return;
60 -
61 - update_temperature(tz);
62 -
63 - for (count = 0; count < tz->trips; count++)
64 - handle_thermal_trip(tz, count);
65 -}
66 -EXPORT_SYMBOL_GPL(thermal_zone_device_update);
67 -
68 static void thermal_zone_device_check(struct work_struct *work)
69 {
70 struct thermal_zone_device *tz = container_of(work, struct