From patchwork Wed May 4 06:02:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9010691 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 527F89F1C1 for ; Wed, 4 May 2016 06:11:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 64A0A20377 for ; Wed, 4 May 2016 06:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D3FC202B8 for ; Wed, 4 May 2016 06:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756923AbcEDGC4 (ORCPT ); Wed, 4 May 2016 02:02:56 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36077 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbcEDGCz (ORCPT ); Wed, 4 May 2016 02:02:55 -0400 Received: by mail-pa0-f53.google.com with SMTP id bt5so19911336pac.3; Tue, 03 May 2016 23:02:55 -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=XZq2ayao1/OZLnEIpD4/98r0iuS3Dcj0jAL+Vog8nrji041JCE+1Ds56V1J1aFedHN SjKq+URtXItk6qF0XIvzGKF9WcCSUA3KhDFEBHGFZDXWU69anE4BYIg7c1P6UjueJ+wD NL+8AOJkAHQKveS0ExGw8e0tgs7eYZfaajq1YexgU01/Gu2Ta5NpM/DZdyG3i/6SmZXE kjL7eiDhsuaHMfa/yxW8qqeu74JLIPaR7MOYKYTX+x+sxwIKDX5Tv/HOK+/bfzN+IFMU cTKFnWF5wGTrIT3Eo2STo8gZgc3mc0lDNQgwiKBIZ3dLWxuQRHmKQoFdja0tadR/ApGF fHww== 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=flMGDTKuo2rr9Db/PvCsr80QclhCHvEzbJpgBk00ABpthJwMOCaHZeCQVcsliwYTgM LUFcV7fbN4YkeZ6vgz+k9YwdMtIoKhDNfTLlBFg5R3G7//rYjCvObkHxccae+uXMXBIC L+B0FtVorlQS3pc42EVrcYtmdWZecPQoQx5FstoDrgM4YOH3sMQg3x06y1acXjmCRK4x TXEL8ZsdkkIpv5qJQDIONiguHy1AJJ2cXPwBKEE/VCJwf9DjyWGmsMmimRUCmWqgz33o J1Jc1VqU2XXJCqhaMA1SmAjgwS4ld+dHhhhmdBHXg9pCp5ATc50/huAaU+UpAD5mUAKh uNhg== X-Gm-Message-State: AOPr4FXCokZ2BgU7GLyqzGgPdzo4woaIzijwSUYnU2fT69/TpRLyZnuWg1seDz0pYOGylA== X-Received: by 10.66.246.228 with SMTP id xz4mr9498020pac.139.1462341774759; Tue, 03 May 2016 23:02:54 -0700 (PDT) Received: from localhost ([2601:647:4203:c8e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id 8sm2622039pfk.69.2016.05.03.23.02.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 23:02:54 -0700 (PDT) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , Eduardo Valentin Subject: [PATCH 02/31] thermal: core: group thermal_zone DEVICE_ATTR's declarations Date: Tue, 3 May 2016 23:02:16 -0700 Message-Id: <1462341765-13268-3-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462341765-13268-1-git-send-email-edubezval@gmail.com> References: <1462341765-13268-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=-8.9 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)