public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: viresh.kumar@st.com (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clk: Allocate and add clock lookups from clk_register()
Date: Fri, 13 Apr 2012 14:55:37 +0530	[thread overview]
Message-ID: <4F87F111.6060400@st.com> (raw)
In-Reply-To: <20120413085627.GD27730@b20223-02.ap.freescale.net>

[Added you question from both threads here :) ]

On 4/13/2012 2:47 PM, Richard Zhao wrote:
> On Fri, Apr 13, 2012 at 02:40:12PM +0530, Viresh Kumar wrote:
>> On 4/13/2012 2:29 PM, Mark Brown wrote:
>>> Or we need to dump the arguments into a struct.
>>
>> Then we would end up creating too many structures in our mach/clock.c
>> files. That will look bad. May perform better. :)
> or pass struct clk_lookup* ? For non-leaf clks, it's NULL.

Non leaf nodes may also need to have clk_lookups, if you want to do
clk_get*() on them, to set their rate or parents.

On 4/13/2012 2:26 PM, Richard Zhao wrote:
>> >  struct clk *clk_register(struct device *dev, const char *name,
>> >  		const struct clk_ops *ops, struct clk_hw *hw,
>> > -		const char **parent_names, u8 num_parents, unsigned long flags)
>> > +		const char **parent_names, u8 num_parents, unsigned long flags,
>> > +		struct clk_lookup **cl, const char *dev_id, const char *con_id)
> 10 arguments. It worths to use a struct ? 

I am not saying no here.

But, with that we pass structs all clk_register_*() routines too. So, we will
create a lot of structures in our mach clock.c file.

Because in most cases this is one time stuff, only at boot, i vote for the
current implementation. :)

I am not an expert but, with my logic i feel with more args system will not
be slower. Performance wise, both should be same. As all args would always be
read from memory and not registers. In case of struct, only address of struct
will be read from cpu registers.

-- 
viresh

  reply	other threads:[~2012-04-13  9:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-13  6:34 [PATCH] clk: Allocate and add clock lookups from clk_register() Viresh Kumar
2012-04-13  8:56 ` Richard Zhao
2012-04-13  9:25   ` Viresh Kumar [this message]
2012-04-13 10:01 ` Sascha Hauer
2012-04-13 10:10   ` Viresh Kumar
2012-04-13 10:30     ` Russell King - ARM Linux
2012-04-13 11:16 ` Domenico Andreoli
2012-04-16  3:48   ` Viresh Kumar

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=4F87F111.6060400@st.com \
    --to=viresh.kumar@st.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox