From: sylvester.nawrocki@gmail.com (Sylwester Nawrocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations
Date: Sat, 24 Aug 2013 17:16:43 +0200 [thread overview]
Message-ID: <5218CE5B.1020906@gmail.com> (raw)
In-Reply-To: <20130823231314.GR6617@n2100.arm.linux.org.uk>
On 08/24/2013 01:13 AM, Russell King - ARM Linux wrote:
> On Fri, Aug 23, 2013 at 05:03:45PM +0200, Sylwester Nawrocki wrote:
>> > This patch adds common __clk_get(), __clk_put() clkdev helpers which
>> > replace their platform specific counterparts when the common clock
>> > API is enabled.
>> >
>> > The owner module pointer field is added to struct clk so a reference
>> > to the clock supplier module can be taken by the clock consumers.
>> >
>> > Signed-off-by: Sylwester Nawrocki<s.nawrocki@samsung.com>
>> > Signed-off-by: Kyungmin Park<kyungmin.park@samsung.com>
>
> I'm mostly happy with this now.
>
>> > +int __clk_get(struct clk *clk)
>> > +{
>> > + if (clk&& !try_module_get(clk->owner))
>> > + return 0;
>> > +
>> > + return 1;
>> > +}
>> > +EXPORT_SYMBOL(__clk_get);
>> > +
>> > +void __clk_put(struct clk *clk)
>> > +{
>> > + if (WARN_ON_ONCE(IS_ERR(clk)))
>> > + return;
>> > +
>> > + if (clk)
>> > + module_put(clk->owner);
>> > +}
>> > +EXPORT_SYMBOL(__clk_put);
>
> Why are these exported? clkdev can only be built into the kernel, as can
> the common clk framework - they can't be modular. So why would a module
> wish to access these directly?
I must have been mislead by the fact that some ARM sub-architecture exports
those, have added them initially and then didn't think enough about it and
left these in. Actually, at some point I noticed the exporting is not
needed,
but never did get around to remove it. Thanks. The updated series to
follow.
next prev parent reply other threads:[~2013-08-24 15:16 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 15:03 [PATCH v3 0/5] clk: clock deregistration support Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 1/5] clk: Provide not locked variant of of_clk_get_from_provider() Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 2/5] clkdev: Fix race condition in clock lookup from device tree Sylwester Nawrocki
2013-08-23 15:22 ` Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 3/5] clk: Add common __clk_get(), __clk_put() implementations Sylwester Nawrocki
2013-08-23 23:13 ` Russell King - ARM Linux
2013-08-24 15:16 ` Sylwester Nawrocki [this message]
2013-08-23 15:03 ` [PATCH v3 4/5] clk: Assign module owner of a clock being registered Sylwester Nawrocki
2013-08-23 15:03 ` [PATCH v3 5/5] clk: Implement clk_unregister Sylwester Nawrocki
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=5218CE5B.1020906@gmail.com \
--to=sylvester.nawrocki@gmail.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;
as well as URLs for NNTP newsgroup(s).