From patchwork Sat Jul 2 01:55:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9210663 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 A129860752 for ; Sat, 2 Jul 2016 01:56:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86F722853E for ; Sat, 2 Jul 2016 01:56:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76AF2286CA; Sat, 2 Jul 2016 01:56:16 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 DB1DD2853E for ; Sat, 2 Jul 2016 01:56:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752537AbcGBBz5 (ORCPT ); Fri, 1 Jul 2016 21:55:57 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:34205 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752328AbcGBBz4 (ORCPT ); Fri, 1 Jul 2016 21:55:56 -0400 Received: by mail-pa0-f68.google.com with SMTP id us13so10889559pab.1; Fri, 01 Jul 2016 18:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=x6mKI+wIdmZEOUV1Oj73DSREhwkgG9jQJ6KNiZbHdwE=; b=lLJjm0PeCXWwInhr0KTbjCB3vxnNv34ZEHewX5Z/bxMChjuDzdPjqpNx9ubQFVKVTn F8EdZvCuILtpY6DPWiFstsYu1YPrqebyilxpMl0+K0s746IDBZju3XUZ1WCX3eYfrDYh KcpIDyDYyn8QqWS0b8ZOw9K3VLo1dwk7LywJeQyflupQJ45e2Zcl9eEUxfnyy5VeKq1w 9rdpJZqSb9wVNtAsFBcDRhxVdWTbbeUVtJPTHVeUA5kjQYFFZTr1DNbvn0UoXm8iuzuS tm2tZ/6oyPApErvAuOV/mms3hbIV8cynXxs3jxOPFYCBMnWbIU41BbPaj42AwmjVvv9M Pn3w== 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; bh=x6mKI+wIdmZEOUV1Oj73DSREhwkgG9jQJ6KNiZbHdwE=; b=UCQSdRZkfhvE1wzG1w4ICPtC1Mnmd02QqdOOza1O2UaFYZ1jRCW0AxL8xQvZHagYFg RkAFehQ76thAuX/ckYiK0jFMJQXJg/ncogsoU06BtaeV9NEi2V19Qtkra40zR8UwWanh QodMr1uM0uof76/0ImjcJB3ctFmaWHuKrqzCTOZVpC6rbAEMolUthuHQbz64mNsD1rTf aHyKP/d0ct7rauYNrpde2TrfVNwPOx/jEY47skwXh8cLy256dal8cOCRhNmWaG0DHYEP NQ5ywygf3P2fqxdmVQxDHul2RZfMkF7vpuApbFGjbsBlAlJIODaPHWlHPzKl9DvvNPR3 jTOg== X-Gm-Message-State: ALyK8tL/blqFro8xA32ZCBtzQH7gn8HgNx92ITpq1N8QGrnSQkT8OujMTmjtb/wJmr3yJA== X-Received: by 10.67.14.233 with SMTP id fj9mr2162722pad.147.1467424555593; Fri, 01 Jul 2016 18:55:55 -0700 (PDT) Received: from localhost ([2601:647:4203:ca60:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id zv2sm727140pac.43.2016.07.01.18.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2016 18:55:54 -0700 (PDT) From: Eduardo Valentin To: Rui Zhang Cc: Eduardo Valentin , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] thermal: core: move slop and offset helpers to thermal_helpers.c Date: Fri, 1 Jul 2016 18:55:50 -0700 Message-Id: <1467424550-12035-1-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 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 84857bdf..792aab7 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1350,36 +1350,6 @@ exit: } 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 5e1c160..2d37d9d 100644 --- a/drivers/thermal/thermal_helpers.c +++ b/drivers/thermal/thermal_helpers.c @@ -142,3 +142,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);