From patchwork Sun Mar 8 21:05:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 5963041 Return-Path: X-Original-To: patchwork-dri-devel@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 91D99BF440 for ; Sun, 8 Mar 2015 21:06:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BEE8F20254 for ; Sun, 8 Mar 2015 21:06:04 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4E10F20270 for ; Sun, 8 Mar 2015 21:06:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 58CED6E135; Sun, 8 Mar 2015 14:06:02 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.13]) by gabe.freedesktop.org (Postfix) with ESMTP id BE4256E135 for ; Sun, 8 Mar 2015 14:06:00 -0700 (PDT) Received: from wuerfel.localnet ([149.172.15.242]) by mrelayeu.kundenserver.de (mreue102) with ESMTPSA (Nemesis) id 0MFcG5-1YGdtw0aF3-00Egae; Sun, 08 Mar 2015 22:05:33 +0100 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] clk: provide clk_is_match() dummy for non-common clk Date: Sun, 08 Mar 2015 22:05:29 +0100 Message-ID: <8682755.oK0Ae34OOP@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20150225172757.421.43718@quantum> References: <1424876018-17852-1-git-send-email-shawn.guo@linaro.org> <1424876018-17852-2-git-send-email-shawn.guo@linaro.org> <20150225172757.421.43718@quantum> MIME-Version: 1.0 X-Provags-ID: V03:K0:VbFJfDqm9mzxjy39edw8hMRY2wPCn9PRJFBrXLLnV+eB7JClie5 nN9m4+6lTUYDS3SkdyMG/9jjql1CIIxxQpswS0AACU3iw344CiR4gLGdKYeDfPm4M7wvvG1 giKK7cyY5UAdPvlcH5Q1TAwJvydXQVPfa4fqtHb3sJRlyyy+rhLROe7mYbWjzcSvOrCxhfy 67Cgsf40D9vB2/jHfI12A== X-UI-Out-Filterresults: notjunk:1; Cc: linux-pwm@vger.kernel.org, alsa-devel@alsa-project.org, Mike Turquette , kernel@pengutronix.de, Greg Kroah-Hartman , Stephen Boyd , dri-devel@lists.freedesktop.org, Mark Brown , linux-serial@vger.kernel.org, Russell King X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 ARM randconfig build tests found a new error for configurations with COMMON_CLK disabled but HAS_CLK selected by the platform: ERROR: "clk_is_match" [sound/soc/fsl/snd-soc-fsl-spdif.ko] undefined! This moves the declaration around, so this case is covered by the existing static inline helper function. Signed-off-by: Arnd Bergmann Fixes: c69e182e51d89 ("clk: introduce clk_is_match") ---- BTW, we have a preexisting problem in clk_get_parent, clk_round_rate and clk_set_parent, which I've worked around in my randconfig builds so far. Should we do that the same way? diff --git a/include/linux/clk.h b/include/linux/clk.h index 5c076e4d90f9..a9b91595d106 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -125,6 +125,19 @@ int clk_set_phase(struct clk *clk, int degrees); */ int clk_get_phase(struct clk *clk); +/** + * clk_is_match - check if two clk's point to the same hardware clock + * @p: clk compared against q + * @q: clk compared against p + * + * Returns true if the two struct clk pointers both point to the same hardware + * clock node. Put differently, returns true if struct clk *p and struct clk *q + * share the same struct clk_core object. + * + * Returns false otherwise. Note that two NULL clks are treated as matching. + */ +bool clk_is_match(struct clk *p, struct clk *q); + #else static inline long clk_get_accuracy(struct clk *clk) @@ -142,6 +155,11 @@ static inline long clk_get_phase(struct clk *clk) return -ENOTSUPP; } +static inline bool clk_is_match(struct clk *p, struct clk *q) +{ + return p == q ? true : false; +} + #endif /** @@ -376,19 +394,6 @@ struct clk *clk_get_parent(struct clk *clk); */ struct clk *clk_get_sys(const char *dev_id, const char *con_id); -/** - * clk_is_match - check if two clk's point to the same hardware clock - * @p: clk compared against q - * @q: clk compared against p - * - * Returns true if the two struct clk pointers both point to the same hardware - * clock node. Put differently, returns true if struct clk *p and struct clk *q - * share the same struct clk_core object. - * - * Returns false otherwise. Note that two NULL clks are treated as matching. - */ -bool clk_is_match(struct clk *p, struct clk *q); - #else /* !CONFIG_HAVE_CLK */ static inline struct clk *clk_get(struct device *dev, const char *id) @@ -442,11 +447,6 @@ static inline struct clk *clk_get_parent(struct clk *clk) return NULL; } -static inline bool clk_is_match(struct clk *p, struct clk *q) -{ - return p == q ? true : false; -} - #endif /* clk_prepare_enable helps cases using clk_enable in non-atomic context. */