[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140930091437.GJ5182@n2100.arm.linux.org.uk>
Date: Tue, 30 Sep 2014 10:14:37 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Tomeu Vizoso <tomeu.vizoso@...labora.com>
Cc: Mike Turquette <mturquette@...aro.org>,
linux-kernel@...r.kernel.org, Stephen Boyd <sboyd@...eaurora.org>,
Javier Martinez Canillas <javier.martinez@...labora.co.uk>
Subject: Re: [RFC] clk: Make clk API return per-user struct clk instances
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists