From patchwork Tue Nov 8 05:09:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 9416525 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 C70D060512 for ; Tue, 8 Nov 2016 05:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B673D28B99 for ; Tue, 8 Nov 2016 05:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A955F28B9B; Tue, 8 Nov 2016 05:14:07 +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 4CCCB28B99 for ; Tue, 8 Nov 2016 05:14:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932223AbcKHFKj (ORCPT ); Tue, 8 Nov 2016 00:10:39 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35869 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbcKHFKf (ORCPT ); Tue, 8 Nov 2016 00:10:35 -0500 Received: by mail-pf0-f194.google.com with SMTP id n85so18051211pfi.3; Mon, 07 Nov 2016 21:10:35 -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=uFUDlMVbMHCthjZUgPG3Z97xNgctYkmd2CXHdSx8Ugs=; b=bB0NWb0U5jynbuJivYSbF6anBRwBUDyqvXU0EWsejLcWxY0PF6PnGjdmeHlqX9/967 97ixKyJO/NeIs7kvmgEJLQAN+ZWqqSuoFlgQKWi1dqm1TsBO5PhlTr++aahOUfx81z6O dCGG+zDmj3gxF8CCDjIZYsoP9IHmyQjC2ZVTN5Kqc9iNqRHpWvfI77G02xd0KLzrLBKi VHlWB961j/jPq0KvwAcHhCXRR6mqZe//KHE5hASnV3CIFwBT0qvNtbtS/CBN739/ikHt KTG2JJOpfs0p3Fb2R+QHkzFnVFlKlC+ZyybAoTSKIsOcM1weZ0iefEt+TyJBqxoq7V28 Z65Q== 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=uFUDlMVbMHCthjZUgPG3Z97xNgctYkmd2CXHdSx8Ugs=; b=DwTxoVNXWpctWF4BxjOeF0SRA1Rj+0mxGj/AzA2XGYQ9qUSyrkMcRXaeSS3pa+upb7 C4pMNH/+3USnK5yqCQJtDk7Qq6ueS2V/WV3GmneT0kpuDnNwsDPCzMKghzC3lpK+xynF 75TooEUU9x52v8G/QbG1KVh6jeidcwW15BoFWRtv69kdzi2w2sosl55HLkZJWRXlInBi VwoXeQOkvTxg5l/lQGXtHY0D1KH6ufS5S7TwcTWDg5A0GV+fFtzYIe734ayBLuHV/bv4 IfgtyNFd+6iC0rRSCwUtpPTr+flJhRhbpigHSvHbbhBc1GF9UMxmF+eVMN7T9coe27CA MHqQ== X-Gm-Message-State: ABUngvfxHSnv0Lf7XrAntSj2hadS2zy4AkGCypAGAx+VJfmx5uSgjMF3eYEzGPjOfueIsw== X-Received: by 10.99.149.90 with SMTP id t26mr8092429pgn.29.1478581835236; Mon, 07 Nov 2016 21:10:35 -0800 (PST) Received: from localhost ([2601:647:4401:a2f0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id s8sm44391243pfj.45.2016.11.07.21.10.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 21:10:34 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: LKML , Linux PM , Eduardo Valentin Subject: [PATCHv2 23/49] thermal: core: move to_cooling_device macro to header file Date: Mon, 7 Nov 2016 21:09:01 -0800 Message-Id: <1478581767-7009-24-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 Make the to_cooling_device() macro available across files in thermal core. 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 | 3 --- drivers/thermal/thermal_core.h | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index b14913e..d55a41a 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -799,9 +799,6 @@ int thermal_build_list_of_policies(char *buf) } /* sys I/F for cooling device */ -#define to_cooling_device(_dev) \ - container_of(_dev, struct thermal_cooling_device, device) - static ssize_t thermal_cooling_device_type_show(struct device *dev, struct device_attribute *attr, char *buf) diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index bd88693..5619243 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -57,6 +57,9 @@ struct thermal_instance { #define to_thermal_zone(_dev) \ container_of(_dev, struct thermal_zone_device, device) +#define to_cooling_device(_dev) \ + container_of(_dev, struct thermal_cooling_device, device) + int thermal_register_governor(struct thermal_governor *); void thermal_unregister_governor(struct thermal_governor *); void thermal_zone_device_rebind_exception(struct thermal_zone_device *,