From patchwork Tue Nov 8 05:08:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9416553 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 E042260512 for ; Tue, 8 Nov 2016 05:15:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF13628B99 for ; Tue, 8 Nov 2016 05:15:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C26EA28B9B; Tue, 8 Nov 2016 05:15:56 +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 49AF528B99 for ; Tue, 8 Nov 2016 05:15:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbcKHFJj (ORCPT ); Tue, 8 Nov 2016 00:09:39 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34975 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbcKHFJh (ORCPT ); Tue, 8 Nov 2016 00:09:37 -0500 Received: by mail-pf0-f195.google.com with SMTP id i88so18050450pfk.2; Mon, 07 Nov 2016 21:09:37 -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=WtSvuXyqmU0CUIlrPNsUx3yce8zl47HJlZ/eNFRgacU=; b=WMbIPxNO0UQEmcf8YO18GP1Ggcy9rcX2n49fA+Nowz0P2duDdMKslTFAvgBhorN6Jo bBMm9BlyUfKwkW03zWpTlCDEpSXmw5a8BSxi39etGa0LZFZwO7T4vSuJZ8d3gVfOXZGR 8nxGKyLAVBS0i6yu9/PEzyRnuTxPgAp9TYDgOgW1MM18mBV9enjcv2aiOcfjMTgjTvCi UyTle1/lugNAsYc6jjuc+Nhq3+pk4oyD6SIDVjxakr9jp0BhsOCxJDp3bRh54FoHD/WU CYi+VwwTP359CzDIdH17+BTzygK/EBZggPe4DGz/Wf3/nZPAVQXA+O9jfDNTTllAcljE MTpg== 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=WtSvuXyqmU0CUIlrPNsUx3yce8zl47HJlZ/eNFRgacU=; b=CPiLQk0usPQINpN8sLj2ZCiZCUOoOT4gHMsgrCbrmidP9541NTslk4mRw+CaYcH+TQ /KTolWXoHYotx4GccdJbxWkeHr65ZhB3RhutUZrLRu68FqO5E57KznqMDf62Tokgz5CD 1zqyIoyy/KN9dDlTl6ysJl2BS8b/1kRH1+WJK68ldfnSCulNHU25vWBaZNpXFBVCm406 f7L976A5dcEjFlSr6s6zTiBhc5Q7TluWEgM6jm94la5sNtrYoZSHggFO/R232e5CZy/b t3QwZ8x9PrQH1DijEcaEEt6vKpYH5rnnLVavQCrA0UO8OOPeV47xBqcbaN8XsGKVnG4v seig== X-Gm-Message-State: ABUngvebuPd308sWs6fr2dhn53KRUgL3xOgKaBGhDXd/U9slnauxar6ZQAJLdXAP8moMaQ== X-Received: by 10.99.0.194 with SMTP id 185mr16058764pga.111.1478581776684; Mon, 07 Nov 2016 21:09:36 -0800 (PST) Received: from localhost ([2601:647:4401:a2f0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id yx8sm44509236pac.29.2016.11.07.21.09.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 21:09:36 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: LKML , Linux PM , Eduardo Valentin Subject: [PATCHv2 02/49] thermal: core: group thermal_zone DEVICE_ATTR's declarations Date: Mon, 7 Nov 2016 21:08:40 -0800 Message-Id: <1478581767-7009-3-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 Simply reorganize the code to have all DEVICE_ATTR's in one point in the file. 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 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index ec0d158..97f314e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -975,7 +975,6 @@ emul_temp_store(struct device *dev, struct device_attribute *attr, return ret ? ret : count; } -static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store); static ssize_t sustainable_power_show(struct device *dev, struct device_attribute *devattr, @@ -1006,8 +1005,6 @@ sustainable_power_store(struct device *dev, struct device_attribute *devattr, return count; } -static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, - sustainable_power_store); #define create_s32_tzp_attr(name) \ static ssize_t \ @@ -1050,6 +1047,16 @@ create_s32_tzp_attr(slope); create_s32_tzp_attr(offset); #undef create_s32_tzp_attr +static DEVICE_ATTR(type, 0444, type_show, NULL); +static DEVICE_ATTR(temp, 0444, temp_show, NULL); +static DEVICE_ATTR(mode, 0644, mode_show, mode_store); +static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); +static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store); +static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL); +static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store); +static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, + sustainable_power_store); + static struct device_attribute *dev_tzp_attrs[] = { &dev_attr_sustainable_power, &dev_attr_k_po, @@ -1159,13 +1166,6 @@ int power_actor_set_power(struct thermal_cooling_device *cdev, return 0; } -static DEVICE_ATTR(type, 0444, type_show, NULL); -static DEVICE_ATTR(temp, 0444, temp_show, NULL); -static DEVICE_ATTR(mode, 0644, mode_show, mode_store); -static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); -static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store); -static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL); - /* sys I/F for cooling device */ #define to_cooling_device(_dev) \ container_of(_dev, struct thermal_cooling_device, device)