From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XuNOg-0000c8-53 for barebox@lists.infradead.org; Fri, 28 Nov 2014 15:23:51 +0000 Message-ID: <1417188206.3748.0.camel@pengutronix.de> From: Lucas Stach Date: Fri, 28 Nov 2014 16:23:26 +0100 In-Reply-To: <1417184946-16128-5-git-send-email-s.hauer@pengutronix.de> References: <1417184946-16128-1-git-send-email-s.hauer@pengutronix.de> <1417184946-16128-5-git-send-email-s.hauer@pengutronix.de> Mime-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH 05/14] ARM: AT91: Always provide clk_set_rate stub To: Sascha Hauer Cc: barebox@lists.infradead.org Am Freitag, den 28.11.2014, 15:28 +0100 schrieb Sascha Hauer: > Some drivers need clk_set_rate. To be able to link with these > drivers enabled provide a clk_set_rate stub. > This commit seem to do something different than what the changelog says. > Signed-off-by: Sascha Hauer > --- > arch/arm/mach-at91/clock.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > > diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c > index a7051c3..125d169 100644 > --- a/arch/arm/mach-at91/clock.c > +++ b/arch/arm/mach-at91/clock.c > @@ -336,8 +336,6 @@ EXPORT_SYMBOL(clk_get_rate); > > /*------------------------------------------------------------------------*/ > > -#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS > - > /* > * For now, only the programmable clocks support reparenting (MCK could > * do this too, with care) or rate changing (the PLLs could do this too, > @@ -379,6 +377,9 @@ int clk_set_rate(struct clk *clk, unsigned long rate) > unsigned long prescale_offset, css_mask; > unsigned long actual; > > + if (!IS_ENABLED(CONFIG_PROGRAMMABLE_CLOCKS)) > + return 0; > + > if (!clk_is_programmable(clk)) > return -EINVAL; > if (clk->users) > @@ -419,6 +420,9 @@ EXPORT_SYMBOL(clk_get_parent); > > int clk_set_parent(struct clk *clk, struct clk *parent) > { > + if (!IS_ENABLED(CONFIG_PROGRAMMABLE_CLOCKS)) > + return -ENOSYS; > + > if (clk->users) > return -EBUSY; > if (!clk_is_primary(parent) || !clk_is_programmable(clk)) > @@ -453,8 +457,6 @@ static void init_programmable_clock(struct clk *clk) > clk->rate_hz = parent->rate_hz / pmc_prescaler_divider(pckr); > } > > -#endif /* CONFIG_AT91_PROGRAMMABLE_CLOCKS */ > - > /*------------------------------------------------------------------------*/ > > /* Register a new clock */ > @@ -483,13 +485,10 @@ int clk_register(struct clk *clk) > else if (clk_is_sys(clk)) { > clk->parent = &mck; > clk->mode = pmc_sys_mode; > - } > -#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS > - else if (clk_is_programmable(clk)) { > + } else if (IS_ENABLED(CONFIG_PROGRAMMABLE_CLOCKS) && clk_is_programmable(clk)) { > clk->mode = pmc_sys_mode; > init_programmable_clock(clk); > } > -#endif > > at91_clk_add(clk); > -- Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ | _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox