Track if the clock name is configured by the platform or not. This is a
preparatory change and will be used by later commits. This also makes
the behavior of the clkname API similar to other ones, which allow
repeated calls to the same API for each CPU.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
goto err;
}
+ /* Another CPU that shares the OPP table has set the clkname ? */
+ if (opp_table->clk_configured)
+ return opp_table;
+
/* clk shouldn't be initialized at this point */
if (WARN_ON(opp_table->clk)) {
ret = -EBUSY;
goto err;
}
+ opp_table->clk_configured = true;
+
return opp_table;
err:
clk_put(opp_table->clk);
opp_table->clk = ERR_PTR(-EINVAL);
+ opp_table->clk_configured = false;
dev_pm_opp_put_opp_table(opp_table);
}
* @supported_hw: Array of version number to support.
* @supported_hw_count: Number of elements in supported_hw array.
* @prop_name: A name to postfix to many DT properties, while parsing them.
+ * @clk_configured: Clock name is configured by the platform.
* @clk: Device's clock handle
* @regulators: Supply regulators
* @regulator_count: Number of power supply regulators. Its value can be -1
unsigned int *supported_hw;
unsigned int supported_hw_count;
const char *prop_name;
+ bool clk_configured;
struct clk *clk;
struct regulator **regulators;
int regulator_count;