From patchwork Fri Mar 4 15:33:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Hunter X-Patchwork-Id: 8504491 X-Patchwork-Delegate: rjw@sisk.pl 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 437F2C0553 for ; Fri, 4 Mar 2016 15:34:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 690602025B for ; Fri, 4 Mar 2016 15:34:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 418CC20259 for ; Fri, 4 Mar 2016 15:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755411AbcCDPdg (ORCPT ); Fri, 4 Mar 2016 10:33:36 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:8313 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbcCDPdg (ORCPT ); Fri, 4 Mar 2016 10:33:36 -0500 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Fri, 04 Mar 2016 07:33:17 -0800 Received: from hqemhub03.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Fri, 04 Mar 2016 07:32:20 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Fri, 04 Mar 2016 07:32:20 -0800 Received: from jonathanh-lm.nvidia.com (172.20.144.16) by hqemhub03.nvidia.com (172.20.150.15) with Microsoft SMTP Server (TLS) id 8.3.406.0; Fri, 4 Mar 2016 07:33:34 -0800 From: Jon Hunter To: "Rafael J. Wysocki" CC: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, Jon Hunter Subject: [PATCH 1/2] PM / clk: Add stubs for pm_clk_suspend/resume Date: Fri, 4 Mar 2016 15:33:04 +0000 Message-ID: <1457105585-25157-1-git-send-email-jonathanh@nvidia.com> X-Mailer: git-send-email 2.1.4 X-NVConfidentiality: public MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The functions pm_clk_suspend() and pm_clk_resume() cannot be used directly within the main body of a function, because when CONFIG_PM_CLK is not defined the functions are defined as NULL and this will lead to a compilation error. Add stubs functions for pm_clk_suspend() and pm_clk_resume() so that these functions may be called directly. Please note that these functions are currently assigned to function pointers in the PM domain core and so to avoid have a valid function pointer defined when CONFIG_PM_CLK is not defined, define GENPD_FLAG_PM_CLK as 0 when CONFIG_PM_CLK is not defined to ensure the stubs are not populated as valid function pointers. Signed-off-by: Jon Hunter --- include/linux/pm_clock.h | 10 ++++++++-- include/linux/pm_domain.h | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h index 25266c600021..ffefbf2df1aa 100644 --- a/include/linux/pm_clock.h +++ b/include/linux/pm_clock.h @@ -72,8 +72,14 @@ static inline int pm_clk_add_clk(struct device *dev, struct clk *clk) static inline void pm_clk_remove(struct device *dev, const char *con_id) { } -#define pm_clk_suspend NULL -#define pm_clk_resume NULL +static inline int pm_clk_suspend(struct device *dev) +{ + return -EINVAL; +} +static inline int pm_clk_resume(struct device *dev) +{ + return -EINVAL; +} #endif #ifdef CONFIG_HAVE_CLK diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 49cd8890b873..1074c2073df8 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h @@ -17,7 +17,11 @@ #include /* Defines used for the flags field in the struct generic_pm_domain */ +#ifdef CONFIG_PM_CLK #define GENPD_FLAG_PM_CLK (1U << 0) /* PM domain uses PM clk */ +#else +#define GENPD_FLAG_PM_CLK 0 +#endif #define GENPD_MAX_NUM_STATES 8 /* Number of possible low power states */