From patchwork Tue Nov 8 05:09:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9416581 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 661D460459 for ; Tue, 8 Nov 2016 05:25:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54FA428B9B for ; Tue, 8 Nov 2016 05:25:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47B2C28B9D; Tue, 8 Nov 2016 05:25:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2CBB28B9B for ; Tue, 8 Nov 2016 05:25:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752328AbcKHFYl (ORCPT ); Tue, 8 Nov 2016 00:24:41 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33643 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbcKHFYi (ORCPT ); Tue, 8 Nov 2016 00:24:38 -0500 Received: by mail-pf0-f195.google.com with SMTP id 144so9729050pfv.0; Mon, 07 Nov 2016 21:24:38 -0800 (PST) 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=J3bGEaZvwx4oDWWCgbjx4jHGTGScirPfWSV0sjbYV6k=; b=WDZCn5HC50nym+rVGdOvVgZ0FVlmMh8vzMHUbc/LpfCANWJppcc8p7ho7ZuSaq3BEL FyzW/psuOb+W+bSRzOFYAD4z0hVEnw3McfLrfdA/72QalT+PJ+hwfwFPUdFLs9LlrixF nNttOXzXhNLv1NxddKScnUXY6utI5dNO+3h1ydfX2sDOryqgjZXddhZn/ztA/4BMsRhN KBOz5gVugzuKK+ULTjFCxQrZMkC5Vm1voNUPhq1lhCcZKsc7HdPIJVfDU+ZEiJGH97p/ 2+xfwqORRlKjtwpfm+Ue2ebNKxorm+O68bV93kIgY/OKNL4/91qVJ8632B8YUXmbLYvk kVkw== 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=J3bGEaZvwx4oDWWCgbjx4jHGTGScirPfWSV0sjbYV6k=; b=anWSBUKY4UyZcoVxyJ1Aztnpbefd1F8+okBx2Fgy1Ei8amiWo5aiRK1qSAfBntluUt 86Dmv+cWI/Zs9Mwd9P+y5boHIirlnhJwX/o825K9586ukcSHQ7m0Q13CNpI3F886eEkA 9qo9+GHNZxatMr2Ul0iV/xIuGWXaf6u6iNQz/YldGzv3REirJHgu3NWndBW3jPTmJQ6I A3VMhu+LHHLJ6B1W60ou48iEC8a1lv/2XNrYSlgOdrXMNoQlK0D5YxulafoOws181JCR 0lq29JzcSHygS55M23KlK5leKJWWjKmPOztJBFVOmKLJbDTouyL0hWwoyBC/DcyAMQsA w43w== X-Gm-Message-State: ABUngvet7TN6mDivDoQCjxICBTQwD/H40k39Uae/m073qyhcoGBBvVO3XFznhJFqGHJcAg== X-Received: by 10.98.38.199 with SMTP id m190mr20315610pfm.45.1478581880043; Mon, 07 Nov 2016 21:11:20 -0800 (PST) Received: from localhost ([2601:647:4401:a2f0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id ix3sm44621861pac.17.2016.11.07.21.11.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 21:11:19 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: LKML , Linux PM , Eduardo Valentin Subject: [PATCHv2 49/49] thermal: core: move slop and offset helpers to thermal_helpers.c Date: Mon, 7 Nov 2016 21:09:27 -0800 Message-Id: <1478581767-7009-50-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1478581767-7009-1-git-send-email-edubezval@gmail.com> References: <1478581767-7009-1-git-send-email-edubezval@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reorganize code to reflect better placement. Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin --- drivers/thermal/thermal_core.c | 30 ------------------------------ drivers/thermal/thermal_helpers.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 4f93844..7daffc1 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1358,36 +1358,6 @@ struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name) } EXPORT_SYMBOL_GPL(thermal_zone_get_zone_by_name); -/** - * thermal_zone_get_slope - return the slope attribute of the thermal zone - * @tz: thermal zone device with the slope attribute - * - * Return: If the thermal zone device has a slope attribute, return it, else - * return 1. - */ -int thermal_zone_get_slope(struct thermal_zone_device *tz) -{ - if (tz && tz->tzp) - return tz->tzp->slope; - return 1; -} -EXPORT_SYMBOL_GPL(thermal_zone_get_slope); - -/** - * thermal_zone_get_offset - return the offset attribute of the thermal zone - * @tz: thermal zone device with the offset attribute - * - * Return: If the thermal zone device has a offset attribute, return it, else - * return 0. - */ -int thermal_zone_get_offset(struct thermal_zone_device *tz) -{ - if (tz && tz->tzp) - return tz->tzp->offset; - return 0; -} -EXPORT_SYMBOL_GPL(thermal_zone_get_offset); - #ifdef CONFIG_NET static const struct genl_multicast_group thermal_event_mcgrps[] = { { .name = THERMAL_GENL_MCAST_GROUP_NAME, }, diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c index dfdba5a..8cdf75a 100644 --- a/drivers/thermal/thermal_helpers.c +++ b/drivers/thermal/thermal_helpers.c @@ -194,3 +194,33 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev) dev_dbg(&cdev->device, "set to state %lu\n", target); } EXPORT_SYMBOL(thermal_cdev_update); + +/** + * thermal_zone_get_slope - return the slope attribute of the thermal zone + * @tz: thermal zone device with the slope attribute + * + * Return: If the thermal zone device has a slope attribute, return it, else + * return 1. + */ +int thermal_zone_get_slope(struct thermal_zone_device *tz) +{ + if (tz && tz->tzp) + return tz->tzp->slope; + return 1; +} +EXPORT_SYMBOL_GPL(thermal_zone_get_slope); + +/** + * thermal_zone_get_offset - return the offset attribute of the thermal zone + * @tz: thermal zone device with the offset attribute + * + * Return: If the thermal zone device has a offset attribute, return it, else + * return 0. + */ +int thermal_zone_get_offset(struct thermal_zone_device *tz) +{ + if (tz && tz->tzp) + return tz->tzp->offset; + return 0; +} +EXPORT_SYMBOL_GPL(thermal_zone_get_offset);