From patchwork Wed May 4 06:02:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9010681 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 3E026BF29F for ; Wed, 4 May 2016 06:11:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63A8820373 for ; Wed, 4 May 2016 06:11:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AF3F202B8 for ; Wed, 4 May 2016 06:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757393AbcEDGKy (ORCPT ); Wed, 4 May 2016 02:10:54 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34252 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756948AbcEDGC5 (ORCPT ); Wed, 4 May 2016 02:02:57 -0400 Received: by mail-pf0-f170.google.com with SMTP id y69so20914393pfb.1; Tue, 03 May 2016 23:02:57 -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=zL5EOEl9J57C6Vo3JKXZLf1YjN86cx/x1A/f4HgkEMY=; b=sjY+Ct9ePtrl89sz3qJBO+NLfp77hQIOs+bCMHsi4Fm5QshWl0CqD5eQyL/V3Dp5PF m6+VFxYzhMPxOgMiiwGo//uYnNTw8QAgxemqIy3SOgPcBOfTT8DMqd+G10hMnAoCrgZZ ph3eFSUIOHcDIyaqD+SRxDk+mYJhmRNhSOk04zNlgbv9QcaQ6/2aLTSUD5Ok9S0EXzzA jePDy1+nBkoVFZKDJvZFXKa4OjI52+9JzHPSUgTGKf8s9bUTON0fSt7Zh9S1htRsp+8p TKxx3fDUarETD6NlERoReWJCemQbRJ+sgA926XIgjxG50IaHtjTXzHwQRB7BeX3ZdYui uVdw== 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=zL5EOEl9J57C6Vo3JKXZLf1YjN86cx/x1A/f4HgkEMY=; b=VEBcKOxQjm+xfrbbcGgZltY38HCwnm/75C8/1efI29yq6myfNKVlwspBxiJUEln4FA ioKwXFbupR6/9vC68auE67hI555TXyg+jBVEWiUjC80LpwuhE6BFtcJicw6/VUvEe8rF UUq1mm4FJ7hE/XRJtONw96o8RC+rpsEgFkUfUETbM/KIAFLSmgvcmYFjBc9KU6YV0hPV /SEIXHyj6hcQaLjLDfL0jGlJXdU65feZxW80pCuKnMgq9v/RjSzWzKMU60ybV2Uphtrw 9FvWLRRuD8s4bA3uIPteLqu2cISZ4z87Ge0pDkl9bM5ktH42K3SL3R626CuCYMYxYelu ZHPw== X-Gm-Message-State: AOPr4FWWqQYaBt6bS+nmDPkaW9IZ4PhhX33teK0ZkMxjjz8uTWO/HrqSOTmU7HNNTcRgUw== X-Received: by 10.98.36.132 with SMTP id k4mr9578743pfk.95.1462341776515; Tue, 03 May 2016 23:02:56 -0700 (PDT) Received: from localhost ([2601:647:4203:c8e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id 194sm2660989pfv.8.2016.05.03.23.02.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 May 2016 23:02:55 -0700 (PDT) From: Eduardo Valentin To: Rui Zhang Cc: Linux PM , LKML , Eduardo Valentin Subject: [PATCH 03/31] thermal: core: group device_create_file() calls that are always created Date: Tue, 3 May 2016 23:02:17 -0700 Message-Id: <1462341765-13268-4-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=ham 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 Simple code reorganization to group files that are always created when registering a thermal zone. 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 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index e28d547..2227264 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1858,14 +1858,6 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, } /* sys I/F */ - result = device_create_file(&tz->device, &dev_attr_type); - if (result) - goto unregister; - - result = device_create_file(&tz->device, &dev_attr_temp); - if (result) - goto unregister; - if (ops->get_mode) { result = device_create_file(&tz->device, &dev_attr_mode); if (result) @@ -1900,13 +1892,16 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, goto unregister; } - /* Create policy attribute */ - result = device_create_file(&tz->device, &dev_attr_policy); + result = device_create_file(&tz->device, &dev_attr_type); if (result) goto unregister; - /* Add thermal zone params */ - result = create_tzp_attrs(&tz->device); + result = device_create_file(&tz->device, &dev_attr_temp); + if (result) + goto unregister; + + /* Create policy attribute */ + result = device_create_file(&tz->device, &dev_attr_policy); if (result) goto unregister; @@ -1915,6 +1910,11 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type, if (result) goto unregister; + /* Add thermal zone params */ + result = create_tzp_attrs(&tz->device); + if (result) + goto unregister; + /* Update 'this' zone's governor information */ mutex_lock(&thermal_governor_lock);