linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
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 00:13:15 +0100	[thread overview]
Message-ID: <20130823231314.GR6617@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1377270227-1030-4-git-send-email-s.nawrocki@samsung.com>

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?

  reply	other threads:[~2013-08-23 23:13 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 [this message]
2013-08-24 15:16     ` Sylwester Nawrocki
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=20130823231314.GR6617@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).