All of lore.kernel.org
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/8] clk: mxs: add clock support for imx23
Date: Tue, 24 Apr 2012 09:10:37 +0800	[thread overview]
Message-ID: <20120424011035.GA26306@S2101-09.ap.freescale.net> (raw)
In-Reply-To: <CAJOA=zMjV0juDhnkUuZTbLVh7eby1rDntkfKY2qGJ-2Y9SfmiQ@mail.gmail.com>

On Mon, Apr 23, 2012 at 04:59:23PM -0700, Turquette, Mike wrote:
> The error codes were added in for a good reason and should be honored.
> 
> >> > diff --git a/drivers/clk/mxs/clk.h b/drivers/clk/mxs/clk.h
> >> > index deb5c23..fb5937d 100644
> >> > --- a/drivers/clk/mxs/clk.h
> >> > +++ b/drivers/clk/mxs/clk.h
> >> > @@ -12,6 +12,8 @@
> >> > ?#ifndef __MXS_CLK_H
> >> > ?#define __MXS_CLK_H
> >> >
> >> > +#include <linux/clk.h>
> >> > +#include <linux/clkdev.h>
> >> > ?#include <linux/clk-provider.h>
> >> > ?#include <linux/err.h>
> >> > ?#include <linux/io.h>
> >> > @@ -72,4 +74,22 @@ static inline int mxs_clk_wait(void __iomem *reg, u8 shift)
> >> > ? ? ? ?return 0;
> >> > ?}
> >> >
> >> > +static inline int mxs_clk_init_on(char **clks_init_on, int num)
> >> > +{
> >> > + ? ? ? struct clk *clk;
> >> > + ? ? ? int i;
> >> > +
> >> > + ? ? ? for (i = 0; i < num; i++) {
> >> > + ? ? ? ? ? ? ? clk = clk_get_sys(clks_init_on[i], NULL);
> >> > + ? ? ? ? ? ? ? if (IS_ERR(clk)) {
> >> > + ? ? ? ? ? ? ? ? ? ? ? pr_err("%s: failed to get clk %s", __func__,
> >> > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?clks_init_on[i]);
> >> > + ? ? ? ? ? ? ? ? ? ? ? return PTR_ERR(clk);
> >> > + ? ? ? ? ? ? ? }
> >> > + ? ? ? ? ? ? ? clk_prepare_enable(clk);
> >> > + ? ? ? }
> >> > +
> >> > + ? ? ? return 0;
> >> > +}
> >>
> >> Any good reason for this code to live in the header as static inline?
> >>
> > It's a small function which is used by both clk-imx23.c and clk-imx28.c.
> >
> >> Do you call this code any time other than at boot? ?Why not __init?
> >>
> > Eh, __init for inline function?
> 
> __init for a non-lined function.  If this code is only called at boot
> then you can move it into a C file and __init it.
> 
> This issue isn't worth blocking the series, but you could just as
> easily put the definition in the clock code for the oldest SoC that
> uses it (imx23 in this case) and declare it in your local clk.h
> 
Ok, if you are strong on this, I would prefer to the current way.
After all, it's a small function and the callers to it have already
been __init.

Should I respin the series to have those registration returns checked?

-- 
Regards,
Shawn

  reply	other threads:[~2012-04-24  1:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21 15:57 [PATCH 0/8] common clk support for mxs Shawn Guo
2012-04-21 15:57 ` [PATCH 1/8] clk: mxs: add mxs specific clocks Shawn Guo
2012-04-21 15:57 ` [PATCH 2/8] clk: mxs: add clock support for imx23 Shawn Guo
2012-04-23 23:07   ` Turquette, Mike
2012-04-23 23:51     ` Shawn Guo
2012-04-23 23:59       ` Turquette, Mike
2012-04-24  1:10         ` Shawn Guo [this message]
2012-04-24  1:16           ` Turquette, Mike
2012-04-24  7:28             ` Shawn Guo
2012-04-21 15:57 ` [PATCH 3/8] clk: mxs: add clock support for imx28 Shawn Guo
2012-04-23 23:22   ` Turquette, Mike
2012-04-25  7:17   ` Sascha Hauer
2012-04-25  8:02     ` Shawn Guo
2012-04-25  8:05       ` Sascha Hauer
2012-04-25  8:48         ` Shawn Guo
2012-04-21 15:57 ` [PATCH 4/8] ARM: mxs: request clock for timer Shawn Guo
2012-04-21 15:57 ` [PATCH 5/8] ARM: mxs: change the lookup name for fec phy clock Shawn Guo
2012-04-21 15:57 ` [PATCH 6/8] ARM: mxs: switch to common clk framework Shawn Guo
2012-04-21 15:57 ` [PATCH 7/8] ARM: mxs: remove old clock support Shawn Guo
2012-04-21 15:57 ` [PATCH 8/8] ARM: mxs: remove now unused timer_clk argument from mxs_timer_init Shawn Guo
2012-04-23 23:40 ` [PATCH 0/8] common clk support for mxs Turquette, Mike
2012-04-23 23:54   ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120424011035.GA26306@S2101-09.ap.freescale.net \
    --to=shawn.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.