From patchwork Fri Jul 21 15:22:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9857171 X-Patchwork-Delegate: sboyd@codeaurora.org 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 BB769601C0 for ; Fri, 21 Jul 2017 15:28:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B06121FFF9 for ; Fri, 21 Jul 2017 15:28:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5418286DE; Fri, 21 Jul 2017 15:28:38 +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 377751FFF9 for ; Fri, 21 Jul 2017 15:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754414AbdGUPZ6 (ORCPT ); Fri, 21 Jul 2017 11:25:58 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:59102 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754609AbdGUPYe (ORCPT ); Fri, 21 Jul 2017 11:24:34 -0400 Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue005 [212.227.15.129]) with ESMTPA (Nemesis) id 0MN95A-1dWLnR3Vyi-006ebX; Fri, 21 Jul 2017 17:23:50 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org, Wan ZongShun Cc: Arnd Bergmann , linux-clk@vger.kernel.org, Stephen Boyd , Michael Turquette , Sekhar Nori , Kevin Hilman , Hartley Sweeten , Alexander Sverdlin , Eric Miao , Haojian Zhuang , Russell King , Alexandre Bailon , Masahiro Yamada , Dmitry Eremin-Solenikov , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] ARM: w90x900: normalize clk API Date: Fri, 21 Jul 2017 17:22:48 +0200 Message-Id: <20170721152250.3310552-4-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170721152250.3310552-1-arnd@arndb.de> References: <20170721152250.3310552-1-arnd@arndb.de> X-Provags-ID: V03:K0:mkEmuIVvhGeWLAtmpo+W9KlkV352JHN56aTdaDHFdYPueN3uWoi LTRHPJqOy4ANDhXm7GgxAmyz8nrsNtUKLsURRyVEKNrjTShcDswJ+jg3n8qYMmrBzW7Ojvv zKlupR04HMlDDpa9+dEnc4tOVy2PAiUJ0iopgaIdfLXOlGnnR10ZNEnQJSv739L1KDSK3X/ VBrzY1jWF3So4NRWGbHCg== X-UI-Out-Filterresults: notjunk:1; V01:K0:pAJ/R6OMiZA=:wZvBKHY3oeqStbHSidyjch GxeUVjGvVR/5It9p7NVEBTXSDpj4/ridx1XrPntBiQotETB+jKVfBpBVWSUcuv/AcGIeDwQ0c R2K84zuIKoB8YVPrK8Odd7nopo/hKYgaX1WG3HZA8vOuaPcOcUq5WKUKpsijA0+P3x/CJe7Ms PiTQzHwQHOGGyhpJPm+T5zk06x4lsXoiUTvAQd2LzUj7JkzLpBIQ2tzGEANZFGan9sbDxOSDQ YERkfvjY+baRnUzIcDvcvp6ieGCKiU9rjqJ35/2eWLVQgaT7I3Ad5dBsJRAsauaxO4NOiB6LL rsgNtn7mIo94HTk1oeQCqfn3eLZtM7I7tPiTnSpF1xT75P0/IivvV8UVZoi/bIhhHElojyfik ZTwXsl/BXFj0xJxhX3p1Wfv+QFVhBvy2Wb8JefWCsKYuRTPgJvIFj6rgzpKtYxaCtHVBz48Ie /773H7WPTzdWNzNgmM+vSQGk+U0Bj7YUWdDT36wVQyfp+UO55bdlVw0dLj/K7QbRGd4tn8KrV clG0cSdvm8cj2CFp/l1IcfJp0rAsmY02/kdW/L5nCJPQYACGvJjAqT6z1YejRsam5Zs0oYLhj EP7CKZ5MiDz67ZFdMpGGuPQA/C8RaCb7dk4h7nGiAxRNgqnj5j3y/7wdKOYwYvxIW4kojOtUG p4q330Bj59lJBEsQlY00VcXnueWC1V0QY/hrE8Yhhy0uZx5zKqmxwHy7xL24nLAeka1KGIXBb LGcZqcNg+WhVnjBgoiMe9xCgJmbU5ET+QGiiVg== Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP w90x900 still provides its own variant of the clk API rather than using the generic COMMON_CLK API. This generally works, but it causes some link errors with drivers using the clk_set_rate, clk_get_parent, clk_set_parent or clk_round_rate functions when a platform lacks those interfaces. This adds empty stub implementations for each of them, and I don't even try to do something useful here but instead just print a WARN() message to make it obvious what is going on if they ever end up being called. The drivers that call these won't be used on these platforms (otherwise we'd get a link error today), so the added code is harmless bloat and will warn about accidental use. A while ago there was a proposal to change w90x900 to use the common-clk implementation, which would be the way it should be handled properly. Signed-off-by: Arnd Bergmann --- arch/arm/mach-w90x900/clock.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/mach-w90x900/clock.c b/arch/arm/mach-w90x900/clock.c index ac6fd1a2cb59..3f93fac98d97 100644 --- a/arch/arm/mach-w90x900/clock.c +++ b/arch/arm/mach-w90x900/clock.c @@ -93,3 +93,32 @@ void nuc900_subclk_enable(struct clk *clk, int enable) __raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK); } + +/* dummy functions, should not be called */ +long clk_round_rate(struct clk *clk, unsigned long rate) +{ + WARN_ON(clk); + return 0; +} +EXPORT_SYMBOL(clk_round_rate); + +int clk_set_rate(struct clk *clk, unsigned long rate) +{ + WARN_ON(clk); + return 0; +} +EXPORT_SYMBOL(clk_set_rate); + +int clk_set_parent(struct clk *clk, struct clk *parent) +{ + WARN_ON(clk); + return 0; +} +EXPORT_SYMBOL(clk_set_parent); + +struct clk *clk_get_parent(struct clk *clk) +{ + WARN_ON(clk); + return NULL; +} +EXPORT_SYMBOL(clk_get_parent);