The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Davide Ciminaghi <ciminaghi@gnudd.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, rubini@gnudd.com, sameo@linux.intel.com,
	giancarlo.asnaghi@st.com, mturquette@linaro.org,
	linus.walleij@linaro.org, rob.herring@calxeda.com,
	broonie@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] x86, pci sta2x11-fixup: add function to access sta2x11 instance id
Date: Tue, 12 Mar 2013 01:51:06 +0100	[thread overview]
Message-ID: <20130312005106.GB15494@mail.gnudd.com> (raw)
In-Reply-To: <201303081613.34371.arnd@arndb.de>

On Fri, Mar 08, 2013 at 04:13:34PM +0000, Arnd Bergmann wrote:
> On Friday 08 March 2013, Davide Ciminaghi wrote:
> > 
> > The sta2x11 instance id will be included in clock names to make them
> > unique in case of multiple sta2x11's living on the same machine.
> > 
> > Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
> 
> I might be missing something, but this seems counterintuitive. Shouldn't
> the clock names really be constant and independent of the instance?
> 
> The instance should be identified already by the dev_name, right?
>
Hi,

sorry for the delay.
Well, I actually wrote this some months ago, so I might also be missing
something (yes, I know I shouldn't :-).
If I understand well, I should call clk_register_* with dev pointing to
the struct device corresponding to the sta2x11 instance to which the clock
belongs and a constant name (while currently I set dev to NULL and use a
different name for each instance of the same clock, by postfixing the name
with an instance id).
You're probably right, even if looking at the code in drivers/clk/clk.c,
there's something I'm not sure about (and I cannot do any tests right now):

_clk_register() takes hw->init->name as clock name, where hw->init->name
should come from the second arg of clk_register_*, if I'm not wrong.
Then __clk_init does:

if (__clk_lookup(clk->name)) {
   	pr_debug("%s: clk %s already initialized\n", __func__, clk->name);
	ret = -EEXIST;
	goto out;
}

Is it actually possible registering multiple clocks with the same name ?
Sorry maybe I missed your point ...


Thanks and regards
Davide

  reply	other threads:[~2013-03-12  0:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 15:31 [PATCH 0/3] sta2x11 common clock framework implementation Davide Ciminaghi
2013-03-08 15:31 ` [PATCH 1/3] x86, pci sta2x11-fixup: add clk related field to struct sta2x11_instance Davide Ciminaghi
2013-03-08 15:31 ` [PATCH 2/3] x86, pci sta2x11-fixup: add function to access sta2x11 instance id Davide Ciminaghi
2013-03-08 16:13   ` Arnd Bergmann
2013-03-12  0:51     ` Davide Ciminaghi [this message]
2013-03-08 15:31 ` [PATCH 3/3] drivers/clk: sta2x11 common clock framework implementation Davide Ciminaghi

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=20130312005106.GB15494@mail.gnudd.com \
    --to=ciminaghi@gnudd.com \
    --cc=arnd@arndb.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=giancarlo.asnaghi@st.com \
    --cc=hpa@zytor.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mturquette@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=rubini@gnudd.com \
    --cc=sameo@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox