From patchwork Tue Jun 28 11:25:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9202961 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 64B456075F for ; Tue, 28 Jun 2016 11:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55713285BD for ; Tue, 28 Jun 2016 11:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47ED5285F7; Tue, 28 Jun 2016 11:25:19 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 C28DA285BD for ; Tue, 28 Jun 2016 11:25:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752188AbcF1LZR (ORCPT ); Tue, 28 Jun 2016 07:25:17 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:13679 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752098AbcF1LZP (ORCPT ); Tue, 28 Jun 2016 07:25:15 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9H003L1BPZK730@mailout2.w1.samsung.com>; Tue, 28 Jun 2016 12:25:11 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-60-57725e975877 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 59.5B.04866.79E52775; Tue, 28 Jun 2016 12:25:11 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O9H00390BPW1390@eusync1.samsung.com>; Tue, 28 Jun 2016 12:25:11 +0100 (BST) From: Krzysztof Kozlowski To: Russell King , linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Turquette , Stephen Boyd , MyungJoo Ham , Kyungmin Park , linux-pm@vger.kernel.org Cc: Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2] clk: Provide notifier stubs when !COMMON_CLK Date: Tue, 28 Jun 2016 13:25:04 +0200 Message-id: <1467113104-8650-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkluLIzCtJLcpLzFFi42I5/e/4Zd3pcUXhBifvcFpsnLGe1eL1C0OL s01v2C0+9txjtbi8aw6bxefeI4wWh6buZbS4eMrV4nbjCjaLH2e6WRy4PC5fu8js8f5GK7vH 5b5eJo++LasYPT5vkgtgjeKySUnNySxLLdK3S+DK2LG6m6Xgt1DF38sPmBsYd/B3MXJySAiY SFyfu5UFwhaTuHBvPVsXIxeHkMBSRomXjUsZIZxGJone+Y1sIFVsAsYSm5cvAasSEVjOJNG0 dg9YglkgU6Jz71x2EFtYwEHi/qqjQHEODhYBVYm2DnmQMK+Am8SSnw8ZIbbJSZw8Npl1AiP3 AkaGVYyiqaXJBcVJ6blGesWJucWleel6yfm5mxghAfR1B+PSY1aHGAU4GJV4eHfUFYYLsSaW FVfmHmKU4GBWEuF9FVsULsSbklhZlVqUH19UmpNafIhRmoNFSZx35q73IUIC6YklqdmpqQWp RTBZJg5OqQbGIyvft068/OOL4eWmWzUS1d5itycqsYb9dM0+YZt5SEVOJfbyxgy7vXsenekS ffWcLbJPwfTtx1Y7vbNs13XEuyZcayw/v/zLLatJy/fW678Xmvc0bt3jpTGM3wUObupfGuGz efrfXW4WP6/L2K9llngk6y0/QeFL/RNRpyVfns2d2GHzcuOLX0osxRmJhlrMRcWJAEo7iFkc AgAA 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 The clk notifier symbols are hidden by COMMON_CLK. However on some platforms HAVE_CLK might be set while COMMON_CLK not which leads to compile test build errors like: $ make.cross ARCH=sh drivers/devfreq/tegra-devfreq.c: In function 'tegra_actmon_rate_notify_cb': >> drivers/devfreq/tegra-devfreq.c:391:16: error: 'POST_RATE_CHANGE' undeclared (first use in this function) if (action != POST_RATE_CHANGE) ^ drivers/devfreq/tegra-devfreq.c: In function 'tegra_devfreq_probe': >> drivers/devfreq/tegra-devfreq.c:654:8: error: implicit declaration of function 'clk_notifier_register' [-Werror=implicit-function-declaration] err = clk_notifier_register(tegra->emc_clock, &tegra->rate_change_nb); ^ Export the macros and data type declarations outside of COMMON_CLK ifdef and provide stubs to fix the compile testing. Reported-by: kbuild test robot Signed-off-by: Krzysztof Kozlowski Tested-by: Bartlomiej Zolnierkiewicz --- Reported when testing patch [1] on ARCH=sh. I don't have the sh cross compile toolchain so I cannot verify whether this fixes reported issue. Tested on similar configuration on MIPS (HAVE_CLK && !COMMON_CLK) [1] http://www.gossamer-threads.com/lists/linux/kernel/2471798 Changes since v1: 1. The struct clk_notifier_data also has to be visible. --- include/linux/clk.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/linux/clk.h b/include/linux/clk.h index 834179f3fa72..123c02788807 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -20,8 +20,6 @@ struct device; struct clk; -#ifdef CONFIG_COMMON_CLK - /** * DOC: clk notifier callback types * @@ -78,6 +76,8 @@ struct clk_notifier_data { unsigned long new_rate; }; +#ifdef CONFIG_COMMON_CLK + /** * clk_notifier_register: register a clock rate-change notifier callback * @clk: clock whose rate we are interested in @@ -140,6 +140,18 @@ bool clk_is_match(const struct clk *p, const struct clk *q); #else +static inline int clk_notifier_register(struct clk *clk, + struct notifier_block *nb) +{ + return -ENOTSUPP; +} + +static inline int clk_notifier_unregister(struct clk *clk, + struct notifier_block *nb) +{ + return -ENOTSUPP; +} + static inline long clk_get_accuracy(struct clk *clk) { return -ENOTSUPP;