From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754152AbdGUJpj (ORCPT ); Fri, 21 Jul 2017 05:45:39 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:29973 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753679AbdGUJpi (ORCPT ); Fri, 21 Jul 2017 05:45:38 -0400 Subject: Re: [PATCH 03/12] ARM: normalize clk API for older platforms To: Arnd Bergmann CC: Kevin Hilman , Hartley Sweeten , Alexander Sverdlin , Eric Miao , Haojian Zhuang , Wan ZongShun , linux-clk , Stephen Boyd , Michael Turquette , Russell King , Alexandre Bailon , Masahiro Yamada , Dmitry Eremin-Solenikov , Linux ARM , Linux Kernel Mailing List References: <20170720154616.3250481-1-arnd@arndb.de> <20170720155132.3250812-1-arnd@arndb.de> From: Sekhar Nori Message-ID: Date: Fri, 21 Jul 2017 15:14:46 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 21 July 2017 01:47 PM, Arnd Bergmann wrote: > On Fri, Jul 21, 2017 at 10:05 AM, Sekhar Nori wrote: > >>> diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c >>> index f5dce9b4e617..89586779526c 100644 >>> --- a/arch/arm/mach-davinci/clock.c >>> +++ b/arch/arm/mach-davinci/clock.c >>> @@ -218,6 +218,12 @@ int clk_set_parent(struct clk *clk, struct clk *parent) >>> } >>> EXPORT_SYMBOL(clk_set_parent); >>> >>> +struct clk *clk_get_parent(struct clk *clk) >>> +{ >>> + return clk->parent; >>> +} >>> +EXPORT_SYMBOL(clk_get_parent); >> >> For mach-davinci change: >> >> Acked-by: Sekhar Nori > > Thanks! > >>> diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c >>> index 39ef3b613912..c1c91fc6e178 100644 >>> --- a/arch/arm/mach-ep93xx/clock.c >>> +++ b/arch/arm/mach-ep93xx/clock.c >>> @@ -323,6 +323,27 @@ unsigned long clk_get_rate(struct clk *clk) >>> } >>> EXPORT_SYMBOL(clk_get_rate); >>> >>> +long clk_round_rate(struct clk *clk, unsigned long rate) >>> +{ >>> + WARN_ON(clk); >>> + return 0; >>> +} >>> +EXPORT_SYMBOL(clk_round_rate); >> >> Its probably better to WARN_ON_ONCE(). Also, since NULL clk is valid, it >> should be probably be WARN_ON_ONCE(1). > > I thought about trying to make it as correct as possible, but then went for > the opposite approach and instead just made the functions as small as > possible to avoid bloat while having the warning in there along with an > obviously wrong implementation. Apparently the davinci version unlike > the others ended up being a correct one after all (let me know if you > want to have a NULL pointer check there). Yeah, that would be better. Thanks! Regards, Sekhar