From patchwork Tue Nov 8 05:08:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9416549 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 3C2CE60512 for ; Tue, 8 Nov 2016 05:15:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CF9928B99 for ; Tue, 8 Nov 2016 05:15:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2131328B9B; Tue, 8 Nov 2016 05:15:37 +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 BE66128B99 for ; Tue, 8 Nov 2016 05:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbcKHFJr (ORCPT ); Tue, 8 Nov 2016 00:09:47 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34531 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731AbcKHFJo (ORCPT ); Tue, 8 Nov 2016 00:09:44 -0500 Received: by mail-pf0-f193.google.com with SMTP id y68so18084886pfb.1; Mon, 07 Nov 2016 21:09:44 -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=R5IdIcIPLO1tTqGlsVNazAKnWT8/wAoT62b1srWiKck=; b=xbeI4T4xhq9ji0txwXwxxbFHU5g9qDGbwjk+k1sfUl4pzMl6xgP+BQdQQnXPsYOE7h /MoMKwMPxHcDQtQytCH4M0iFF542WuC7oAfTswWWlh+AcxumsLGl2ChFhtKtNhYWCskn 5Qo8+jIILZWIv4WfPClrdCVrNIFASLtzuWQvt6/Dtog08D3rcrQRhnhoRxsmbkOg+0l0 1hOTHM+3DFG6CXGvDrsiqBovTiFLdhyDwDnQjpZj33oA11bzq8WVI0TqfgFaQCdnqMO3 hem4ufy6JoyPbjl0JozzMIzcEFd9ILb6xBX/myQoTt8N77ee3TTYe8XoOjiFIJp3/qx8 DC8Q== 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=R5IdIcIPLO1tTqGlsVNazAKnWT8/wAoT62b1srWiKck=; b=R108CZkllRtfE5WbgGfMznZvvTWiVIzY5pto/3SRRhGfgAbJMayenpK1puEyvOhYJS hW/7ivpYnwGcoEXGmNkc+SPZio6HXKfwkwMFo7wDluDcMdjvQFiXrsTZrj53i/ycESZm GrLL/zRUTp7OX0MMtEs1gcVUvAji7jq8PZeYvlTotmSQitaLIgd5VdwGr5iljKwYXJAR 3yxF10r4+GyM5Jb52tauyqQ06szgCxXwKJkgZUG8e/SBDqi+Yt5ofv6q3cAJGl9gJQIK yKJhdd9pXFvf4jdOMMRWAdLL1DzveLLvpU0AVVbKuxd8L+gH3u0hRo1O9QC3XkCca1WV QEIw== X-Gm-Message-State: ABUngveVpADQjpLpTabtn4WK/ZVzSMRFrimSuJB3nxvFxX4AXQS3XgOLJvwKvAt4U7ApVQ== X-Received: by 10.99.238.17 with SMTP id e17mr4093238pgi.154.1478581783784; Mon, 07 Nov 2016 21:09:43 -0800 (PST) Received: from localhost ([2601:647:4401:a2f0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id n7sm44375138pfn.62.2016.11.07.21.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 21:09:43 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: LKML , Linux PM , Eduardo Valentin Subject: [PATCHv2 05/49] thermal: core: move emul_temp creation to tz->device.groups Date: Mon, 7 Nov 2016 21:08:43 -0800 Message-Id: <1478581767-7009-6-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 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 3da4cd3..ec15a60 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1054,6 +1054,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, @@ -1062,11 +1063,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, @@ -1957,12 +1960,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);