From patchwork Wed May 4 06:02:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9010631 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C0D0BF29F for ; Wed, 4 May 2016 06:10:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E43920373 for ; Wed, 4 May 2016 06:10:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E875202B8 for ; Wed, 4 May 2016 06:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757061AbcEDGDB (ORCPT ); Wed, 4 May 2016 02:03:01 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34263 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757019AbcEDGDA (ORCPT ); Wed, 4 May 2016 02:03:00 -0400 Received: by mail-pf0-f177.google.com with SMTP id y69so20915028pfb.1; Tue, 03 May 2016 23:03:00 -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=wBfzHOt7JFPAGc9Azw5NWrBJCBSZj3s36h4DDxaSzHc=; b=WgXCI2sZRWkFb5YMyEfWXiM/BUhp5OgnZwA1UTIx0Vve7Xn1YXwBVLDddhQ8Pg8hYE r6ruZtGYnnKqOAUMKeN2w7yejOqXOnZ37Xus5KCTBzL6G429eStC8AQcxp7Ugzq72wyY czgXi1QQYOmX/j1XYCH4R4sDF+cHjaZI3IFsMPA7A3fmlDDp3j87NPDGDVeOMma5PfKT Pp3OD4wXgCtqjcI4XH5NKIQKo+SDNFUYmEGfnvkMZ5OXJ50PJA1cMWe4SoLuStj8UZaP cd+tKJO6ZUvpLpGgZyKxB8mWSEjT4PBPDQRt0NbG2ddFk+czHhqaruMZDsE+lYmU3Pbw fRtg== 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=wBfzHOt7JFPAGc9Azw5NWrBJCBSZj3s36h4DDxaSzHc=; b=OAGg7t5vkthn4pCY0YolTM6boL+wkPIfYfBt2IWoHYKon8ZkilpgsycN57Ug1fyjl/ od1/9tcwVO6ogIuADOm83Mc8T/QC9qLr32VMm4YU638S9PcnKXDwwv0ZcNi3I54ym1Ko Vao+6IwL9bcqPtofUjZZAXF0fE7zD8Wqr6jwdj/sNr2fd6zUXiIJIRCiF8TEbsjXpZoV YV0Bnl3Cs0lhrDkE/sS1yn/wZuxmQOJljdP+iWA2umIEuuIK1Hz06GH3jsyiwDesrXqh n1f/ONDGoAL0jQ49pov6DzC7lx4aOs70XsMeTtqFPhSKkHjOjLMlWlItap708oSPVOjU JHYg== X-Gm-Message-State: AOPr4FX+Xm9z7+fXt4J1hz90IavAoQ8Y7MxcwG9k1CwUM6MGX150ENL7UwUAbxYDckw0cg== X-Received: by 10.98.69.132 with SMTP id n4mr9505428pfi.53.1462341779641; Tue, 03 May 2016 23:02:59 -0700 (PDT) Received: from localhost ([2601:647:4203:c8e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id r73sm2656891pfi.4.2016.05.03.23.02.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 23:02:58 -0700 (PDT) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , Eduardo Valentin Subject: [PATCH 05/31] thermal: core: move emul_temp creation to tz->device.groups Date: Tue, 3 May 2016 23:02:19 -0700 Message-Id: <1462341765-13268-6-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 emul_temp creation is dependent on a compile time condition. Moving to tz->device.groups. 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 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 0a7d918..e32f851 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -996,6 +996,7 @@ create_s32_tzp_attr(offset); */ static DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(temp, 0444, temp_show, NULL); +static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_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(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, @@ -1004,11 +1005,13 @@ static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show, /* These thermal zone device attributes are created based on conditions */ static DEVICE_ATTR(mode, 0644, mode_show, mode_store); static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); -static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store); static struct attribute *thermal_zone_dev_attrs[] = { &dev_attr_type.attr, &dev_attr_temp.attr, +#if (IS_ENABLED(CONFIG_THERMAL_EMULATION)) + &dev_attr_emul_temp.attr, +#endif &dev_attr_policy.attr, &dev_attr_available_policies.attr, &dev_attr_sustainable_power.attr, @@ -1893,12 +1896,6 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, goto unregister; } - if (IS_ENABLED(CONFIG_THERMAL_EMULATION)) { - result = device_create_file(&tz->device, &dev_attr_emul_temp); - if (result) - goto unregister; - } - /* Update 'this' zone's governor information */ mutex_lock(&thermal_governor_lock);