From patchwork Sat Apr 23 23:34:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 8919211 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0DECB9F441 for ; Sat, 23 Apr 2016 23:37:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DEE42021A for ; Sat, 23 Apr 2016 23:37:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47DA32020F for ; Sat, 23 Apr 2016 23:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752553AbcDWXet (ORCPT ); Sat, 23 Apr 2016 19:34:49 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:35737 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923AbcDWXes (ORCPT ); Sat, 23 Apr 2016 19:34:48 -0400 Received: by mail-pf0-f178.google.com with SMTP id n1so53454841pfn.2; Sat, 23 Apr 2016 16:34:47 -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:in-reply-to:references; bh=FDdeV5+S0+Gp3VN5lb+3+1+kKGGBPgu6lhW/AySd3bs=; b=ekzt89YRKqjpwoas6C0Fti43e67XC6nYO036f/AUB7aTD6gK8obNNLQpZIXA69dvja iFxcsUNB4P1o12af95q65H2WO9hrkw3pdFzvvDSrnQBuE7g+x3IwTx3PfWHm7ljWq6EN FblBxZMkLR0dmsMtkUm3HEF5JNP0r/yGcRwyDEqL0Fq4swX1iedSDQjn5KAgjvU58F6q J8tyZrzNWaYLD7JA/EFFEX4KsqPBei29TUc82y8KYjidbHs2PBzGoXJfOx2X48HBjmI6 b3NhHDAeqQ13vSFA/3UUMhe9Lz3HyeI3ObhD/IOQr1C+wLwbHD65RJx6m6QlvEi3kTvr f3RA== 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=FDdeV5+S0+Gp3VN5lb+3+1+kKGGBPgu6lhW/AySd3bs=; b=kpm4y3rtFBt7AWAoKEyp755LTEx46OnLXUPc0cjXf2nZK3bOdvp7a9k4mBA88AF7TI lWIGG4zFlWlgs/cTK+Van5CyuBy9hMUQnk0+bmYXc4gkG6/KmRPhlMgC9P9KOu6CCDrt NcPMyVEOKz4h1gTjip7rkLISidvfmYjOe6mVj46gyBNpzSI7+TzlR83vaA9+PRMmDVwu h/UPgcEiojEoMbjwc8z4+7k0CJxsHnBaCVXbUIxnmI3y3VfN8/N6vCerGvArJVHk5Jtl pzltlOXq4H1eRlWbljI/93xsZsoxY9HMWioSRNdnpsQ/2FFyJepsnaotWDYsvOAVJgd7 cOEg== X-Gm-Message-State: AOPr4FWoZiFn46q1Lveqltps1BfJ71tadSvoxJYli6A99pSo5puyuEf2s1U6wjoqi6tF3Q== X-Received: by 10.98.41.65 with SMTP id p62mr12164203pfp.29.1461454487393; Sat, 23 Apr 2016 16:34:47 -0700 (PDT) Received: from localhost ([2601:647:4203:c8e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id lz5sm18810299pab.34.2016.04.23.16.34.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Apr 2016 16:34:46 -0700 (PDT) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , Eduardo Valentin Subject: [RFC PATCH 02/11] thermal: group thermal_zone DEVICE_ATTR's declarations Date: Sat, 23 Apr 2016 16:34:21 -0700 Message-Id: <1461454470-27714-3-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1461454470-27714-1-git-send-email-edubezval@gmail.com> References: <1461454470-27714-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-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.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 650e5fa..e28d547 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -917,7 +917,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, @@ -948,8 +947,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 \ @@ -992,6 +989,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, @@ -1099,13 +1106,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)