Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1409488
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Eduardo Valentin <edubezval@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | [PATCHv2 34/40] thermal: core: move __bind() to where it is used |
| Date | Mon, 30 May 2016 23:30:01 +0200 |
| Message-ID | <rECV3-1mL-5@gated-at.bofh.it> (permalink) |
| References | <rECV3-1mL-7@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0aD2Voo3REksNnIDmiLEmvd/I0ipjbc7SrIIch6LBs8=; b=Ub6ESMGCOKGCc5HBtNPIIc+KRjNMlNmWrw7/Z8kJZtEjmbTZ8OKmE54jD5J5k/nvzk 4d1mXP90RxRbpVcg8cj043KJPpxG9Jscly1rigDTXI9wjdKqVBu61amHJAwRxoXPYs2t 6vb5GeUI5rtf9B2lvGpXaPDAnxi7JVK5f7T66/tvLCHJheo2vI0Mqt/IgJEfzUpBiizS t5Ps4r1Mcox82gBXMf5I0KubX5XcbWKsoy0n6TYn9DQqObD/fdgRblDI3uW26aBNKnUN mtptspEIA4nZzqgDgWEJUgOog8qXyh9JYy7/f2HkC6uhng0A9k8GpwkEG0tLss9WnYee FmpQ== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0aD2Voo3REksNnIDmiLEmvd/I0ipjbc7SrIIch6LBs8=; b=YNpHelJ6G3b9eQmi7lNVwhiUwO98S9rh9sNJks/U2E4znyZWqd3Rkar3Sldd3P1Ga4 sL1fE5GiAA00k0YZLRpqSvcQvplB/RZk6geK86ESqBM75n9bGXaKMrl5vB9ngXL29J7z TdOU2MoWBg5UzRBsttRqoNQtbGuZjj5v3fd04iScXXGZrjobp+KXKSTsjq8F64u28Z4Y h5ZuThPaG15fQh26c8q7LFSr5Tg/63wbeHB9C8S6FaNFRntNy/Am74i/vHQMNfkcZkVs wVv2xhnbKLmQaB8xROItld0EYTxQYkDXSgsSHKZCfp0oCWaQi6QxBX2rbo4eVZ7JVyED F+kw== |
| X-Gm-Message-State | ALyK8tLl7Uoxx8g4k61O9+rty1vRECTgXsQIloek9+hzVL5C91NHNtFYzqbswZZfCwcn3w== |
| X-Received | by 10.98.92.133 with SMTP id q127mr10905529pfb.103.1464643755881; Mon, 30 May 2016 14:29:15 -0700 (PDT) |
| X-Mailer | git-send-email 2.1.4 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 96 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Linux PM <linux-pm@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>, Eduardo Valentin <edubezval@gmail.com> |
| X-Original-Date | Mon, 30 May 2016 14:27:53 -0700 |
| X-Original-Message-ID | <1464643679-2733-35-git-send-email-edubezval@gmail.com> |
| X-Original-References | <1464643679-2733-1-git-send-email-edubezval@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1409488 |
Show key headers only | View raw
Moving the helper to closer where it is used.
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
---
drivers/thermal/thermal_core.c | 66 +++++++++++++++++++++---------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 59fe92d..460220c 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -286,39 +286,6 @@ static void thermal_unregister_governors(void)
thermal_gov_power_allocator_unregister();
}
-static void print_bind_err_msg(struct thermal_zone_device *tz,
- struct thermal_cooling_device *cdev, int ret)
-{
- dev_err(&tz->device, "binding zone %s with cdev %s failed:%d\n",
- tz->type, cdev->type, ret);
-}
-
-static void __bind(struct thermal_zone_device *tz, int mask,
- struct thermal_cooling_device *cdev,
- unsigned long *limits,
- unsigned int weight)
-{
- int i, ret;
-
- for (i = 0; i < tz->trips; i++) {
- if (mask & (1 << i)) {
- unsigned long upper, lower;
-
- upper = THERMAL_NO_LIMIT;
- lower = THERMAL_NO_LIMIT;
- if (limits) {
- lower = limits[i * 2];
- upper = limits[i * 2 + 1];
- }
- ret = thermal_zone_bind_cooling_device(tz, i, cdev,
- upper, lower,
- weight);
- if (ret)
- print_bind_err_msg(tz, cdev, ret);
- }
- }
-}
-
static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
int delay)
{
@@ -804,6 +771,39 @@ static struct class thermal_class = {
.dev_release = thermal_release,
};
+static void print_bind_err_msg(struct thermal_zone_device *tz,
+ struct thermal_cooling_device *cdev, int ret)
+{
+ dev_err(&tz->device, "binding zone %s with cdev %s failed:%d\n",
+ tz->type, cdev->type, ret);
+}
+
+static void __bind(struct thermal_zone_device *tz, int mask,
+ struct thermal_cooling_device *cdev,
+ unsigned long *limits,
+ unsigned int weight)
+{
+ int i, ret;
+
+ for (i = 0; i < tz->trips; i++) {
+ if (mask & (1 << i)) {
+ unsigned long upper, lower;
+
+ upper = THERMAL_NO_LIMIT;
+ lower = THERMAL_NO_LIMIT;
+ if (limits) {
+ lower = limits[i * 2];
+ upper = limits[i * 2 + 1];
+ }
+ ret = thermal_zone_bind_cooling_device(tz, i, cdev,
+ upper, lower,
+ weight);
+ if (ret)
+ print_bind_err_msg(tz, cdev, ret);
+ }
+ }
+}
+
static void bind_cdev(struct thermal_cooling_device *cdev)
{
int i, ret;
--
2.1.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCHv2 34/40] thermal: core: move __bind() to where it is used Eduardo Valentin <edubezval@gmail.com> - 2016-05-30 23:30 +0200
csiph-web