From patchwork Tue Jun 28 06:20:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9201989 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 4C9916075F for ; Tue, 28 Jun 2016 06:21:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EEB9285E6 for ; Tue, 28 Jun 2016 06:21:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F27D285F0; Tue, 28 Jun 2016 06:21:06 +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 313E3285E6 for ; Tue, 28 Jun 2016 06:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750888AbcF1GVD (ORCPT ); Tue, 28 Jun 2016 02:21:03 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:58095 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbcF1GVB (ORCPT ); Tue, 28 Jun 2016 02:21:01 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O9G004LOXMMDX60@mailout1.w1.samsung.com>; Tue, 28 Jun 2016 07:20:46 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-6e-5772173d24c6 Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id D0.DA.05254.D3712775; Tue, 28 Jun 2016 07:20:45 +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 <0O9G00LZKXMGUZ50@eusync1.samsung.com>; Tue, 28 Jun 2016 07:20:45 +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] clk: Provide notifier stubs when !COMMON_CLK Date: Tue, 28 Jun 2016 08:20:33 +0200 Message-id: <1467094833-7553-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupiluLIzCtJLcpLzFFi42I5/e/4ZV1b8aJwg/UnNC02zljPavH6haHF 2aY37BYfe+6xWlzeNYfN4nPvEUaLQ1P3MlpcPOVqcbtxBZvFjzPdLA5cHpevXWT2eH+jld3j cl8vk0ffllWMHp83yQWwRnHZpKTmZJalFunbJXBl/Li/krHgpmDF0XPXWBoY1/F1MXJySAiY SNz7doMZwhaTuHBvPVsXIxeHkMBSRomjM9cxQTiNTBJzTrSxg1SxCRhLbF6+BKxKRGA5k0TT 2j1sIAlmgUyJzr1zwYqEBWwlph84zgJiswioSkx8eheshlfATeJO909WiHVyEiePTWadwMi9 gJFhFaNoamlyQXFSeq6hXnFibnFpXrpecn7uJkZICH3Zwbj4mNUhRgEORiUe3h11heFCrIll xZW5hxglOJiVRHgbRYvChXhTEiurUovy44tKc1KLDzFKc7AoifPO3fU+REggPbEkNTs1tSC1 CCbLxMEp1cCYcejn9IgDIXrLj67d46iQf3/aDsU5C1/liln8i5zLdbzUSfG7+BMDxhIrvmVL Dmje6ewp3zZlI/fiaV3rfLfe3dNbPF10u77Kt+azrUve/K3UK95XkvRoToHk8r/5wQbHCna9 4P9dnB/qFyPfNqH6Y+C/x+8S4vx69x6Mu5Hz5p8YS1KCzP80JZbijERDLeai4kQAfVrVwB0C AAA= 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 --- 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. [1] http://www.gossamer-threads.com/lists/linux/kernel/2471798 --- 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..c83b8a9ffc14 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 * @@ -61,6 +59,8 @@ struct clk_notifier { struct list_head node; }; +#ifdef CONFIG_COMMON_CLK + /** * struct clk_notifier_data - rate data to pass to the notifier callback * @clk: struct clk * being changed @@ -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;