mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Mike Turquette <mturquette@linaro.org>,
	linux-kernel@vger.kernel.org, Stephen Boyd <sboyd@codeaurora.org>,
	Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Subject: Re: [RFC] clk: Make clk API return per-user struct clk instances
Date: Tue, 30 Sep 2014 10:14:37 +0100	[thread overview]
Message-ID: <20140930091437.GJ5182@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1412014643-29099-1-git-send-email-tomeu.vizoso@collabora.com>

On Mon, Sep 29, 2014 at 08:17:23PM +0200, Tomeu Vizoso wrote:
> diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c
> index da4bda8..ab22460 100644
> --- a/drivers/clk/clkdev.c
> +++ b/drivers/clk/clkdev.c
> @@ -168,14 +168,20 @@ static struct clk_lookup *clk_find(const char *dev_id, const char *con_id)
>  struct clk *clk_get_sys(const char *dev_id, const char *con_id)
>  {
>  	struct clk_lookup *cl;
> +	struct clk *clk = NULL;
>  
>  	mutex_lock(&clocks_mutex);
>  	cl = clk_find(dev_id, con_id);
> -	if (cl && !__clk_get(cl->clk))
> -		cl = NULL;
> +	if (cl) {
> +		clk = __clk_create_clk(cl->clk);
> +		if (clk && !__clk_get(clk)) {
> +			__clk_free_clk(clk);
> +			clk = NULL;
> +		}
> +	}
>  	mutex_unlock(&clocks_mutex);
>  
> -	return cl ? cl->clk : ERR_PTR(-ENOENT);
> +	return clk ? clk : ERR_PTR(-ENOENT);

NAK.  We have places where we explicitly expect clk_get* to return NULL.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  parent reply	other threads:[~2014-09-30  9:14 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 18:40 [PATCH v13 0/9] Per-user clock constraints Tomeu Vizoso
2014-09-23 18:40 ` [PATCH v13 1/9] clk: Add temporary mapping to the existing API Tomeu Vizoso
2014-09-23 18:44 ` [PATCH v13 3/9] clk: use struct clk only for external API Tomeu Vizoso
2014-09-23 18:44   ` [PATCH v13 4/9] clk: per-user clock accounting for debug Tomeu Vizoso
2014-09-23 18:44   ` [PATCH v13 5/9] clk: Add floor and ceiling constraints to clock rates Tomeu Vizoso
2014-09-23 18:44   ` [PATCH v13 6/9] clk: Warn of unbalanced clk_prepare() calls Tomeu Vizoso
2014-09-23 18:44   ` [PATCH v13 7/9] clk: Take the prepare lock when updating the list of per-user clks Tomeu Vizoso
2014-09-23 18:44   ` [PATCH v13 8/9] clk: Take the prepare lock when updating the per-user constraints Tomeu Vizoso
2014-09-23 18:44   ` [PATCH v13 9/9] clk: Add docs about calling clk_put after clk_get_parent Tomeu Vizoso
2014-09-23 20:59 ` [PATCH v13 0/9] Per-user clock constraints Stephen Boyd
2014-09-24  8:27   ` Tomeu Vizoso
2014-09-26  1:29     ` Stephen Boyd
2014-09-26  8:09       ` Tomeu Vizoso
2014-09-26 23:20         ` Mike Turquette
2014-09-27  0:15           ` Stephen Boyd
2014-09-29 18:17           ` [RFC] clk: Make clk API return per-user struct clk instances Tomeu Vizoso
2014-09-30  1:40             ` Stephen Boyd
2014-09-30  6:54               ` Mike Turquette
2014-09-30  7:41                 ` Tero Kristo
2014-09-30 18:16                   ` Tony Lindgren
2014-10-03 14:13                     ` Tero Kristo
2014-09-30  9:14             ` Russell King - ARM Linux [this message]
2014-09-30 14:28           ` [RFC v2] " Tomeu Vizoso
2014-09-24  9:14 ` [PATCH v13 0/9] Per-user clock constraints Tomeu Vizoso

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=20140930091437.GJ5182@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=javier.martinez@collabora.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    --cc=tomeu.vizoso@collabora.com \
    /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

all inboxes | Powered by JetHome®