From patchwork Mon Jun 11 08:44:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 927528 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41465p2QBSz9ryk for ; Mon, 11 Jun 2018 18:45:02 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754188AbeFKIoi (ORCPT ); Mon, 11 Jun 2018 04:44:38 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:46550 "EHLO laurent.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754157AbeFKIoc (ORCPT ); Mon, 11 Jun 2018 04:44:32 -0400 Received: from ayla.of.borg ([84.194.111.163]) by laurent.telenet-ops.be with bizsmtp id xLkS1x00V3XaVaC01LkSsv; Mon, 11 Jun 2018 10:44:31 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.86_2) (envelope-from ) id 1fSIR8-0006xN-FF; Mon, 11 Jun 2018 10:44:26 +0200 Received: from geert by ramsan with local (Exim 4.86_2) (envelope-from ) id 1fSIR8-0005OE-E8; Mon, 11 Jun 2018 10:44:26 +0200 From: Geert Uytterhoeven To: Greg Ungerer , Ralf Baechle , James Hogan , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Corentin Labbe , "David S . Miller" Cc: Arnd Bergmann , linux-m68k@lists.linux-m68k.org, linux-mips@linux-mips.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 1/3] m68k: coldfire: Normalize clk API Date: Mon, 11 Jun 2018 10:44:21 +0200 Message-Id: <1528706663-20670-2-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528706663-20670-1-git-send-email-geert@linux-m68k.org> References: <1528706663-20670-1-git-send-email-geert@linux-m68k.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Coldfire 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_round_rate(), clk_set_rate(), clk_set_parent(), or clk_get_parent() 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. Based on commit bd7fefe1f06ca6cc ("ARM: w90x900: normalize clk API"). Signed-off-by: Geert Uytterhoeven Acked-by: Greg Ungerer --- arch/m68k/coldfire/clk.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/m68k/coldfire/clk.c b/arch/m68k/coldfire/clk.c index 849cd208e2ed99e6..7bc666e482ebe82f 100644 --- a/arch/m68k/coldfire/clk.c +++ b/arch/m68k/coldfire/clk.c @@ -129,4 +129,33 @@ unsigned long clk_get_rate(struct clk *clk) } EXPORT_SYMBOL(clk_get_rate); +/* 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); + /***************************************************************************/