[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1491931159.31718.16.camel@nxp.com>
Date: Tue, 11 Apr 2017 20:19:19 +0300
From: Leonard Crestez <leonard.crestez@....com>
To: Dong Aisheng <aisheng.dong@....com>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <kernel@...gutronix.de>,
<broonie@...nel.org>, <yibin.gong@....com>, <rjw@...ysocki.net>,
<viresh.kumar@...aro.org>, <mturquette@...libre.com>,
<sboyd@...eaurora.org>, <shawnguo@...nel.org>,
<fabio.estevam@....com>, <anson.huang@....com>, <ping.bai@....com>,
<octavian.purdila@....com>, <linux-clk@...r.kernel.org>
Subject: Re: [RFC PATCH 1/3] clk: add clk_bulk_get accessories
On Wed, 2017-04-12 at 12:03 +0800, Dong Aisheng wrote:
> +/**
> + * clk_bulk_enable - ungate a bulk of clocks
> + * @num_clks: the number of clk_bulk_data
> + * @clks: the clk_bulk_data table being ungated
> + *
> + * clk_bulk_enable must not sleep
> + * Returns 0 on success, -EERROR otherwise.
> + */
> +int clk_bulk_enable(int num_clks, struct clk_bulk_data *clks)
> +{
> + int ret;
> + int i;
> +
> + for (i = 0; i < num_clks; i++) {
> + ret = clk_enable(clks[i].clk);
> + if (ret) {
> + pr_err("Failed to enable clk '%s': %d\n",
> + clks[i].id, ret);
> + goto err;
> + }
> + }
> +
> + return 0;
> +
> +err:
> + while (--i >= 0)
> + clk_put(clks[i].clk);
Shouldn't this be clk_disable?
And you can probably use clk_bulk_disable(i, clks) instead
Powered by blists - more mailing lists