clk: sunxi: Use CLK_IS_CRITICAL flag for critical clks

We'd like to privatize __clk_get(), but the sunxi clk driver is
calling this function to keep a reference held on the clk and
call clk_prepare_enable() on it. We support this design in the
clk core now with the CLK_IS_CRITICAL flag, so let's just use
that instead.

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
Stephen Boyd
2018-01-02 16:50:27 -08:00
parent e0af0c1610
commit 9919d44ff2
6 changed files with 44 additions and 47 deletions

View File

@@ -176,10 +176,10 @@ static const struct clk_ops clk_factors_ops = {
.set_rate = clk_factors_set_rate,
};
struct clk *sunxi_factors_register(struct device_node *node,
const struct factors_data *data,
spinlock_t *lock,
void __iomem *reg)
static struct clk *__sunxi_factors_register(struct device_node *node,
const struct factors_data *data,
spinlock_t *lock, void __iomem *reg,
unsigned long flags)
{
struct clk *clk;
struct clk_factors *factors;
@@ -249,7 +249,7 @@ struct clk *sunxi_factors_register(struct device_node *node,
parents, i,
mux_hw, &clk_mux_ops,
&factors->hw, &clk_factors_ops,
gate_hw, &clk_gate_ops, 0);
gate_hw, &clk_gate_ops, CLK_IS_CRITICAL);
if (IS_ERR(clk))
goto err_register;
@@ -272,6 +272,22 @@ err_factors:
return NULL;
}
struct clk *sunxi_factors_register(struct device_node *node,
const struct factors_data *data,
spinlock_t *lock,
void __iomem *reg)
{
return __sunxi_factors_register(node, data, lock, reg, 0);
}
struct clk *sunxi_factors_register_critical(struct device_node *node,
const struct factors_data *data,
spinlock_t *lock,
void __iomem *reg)
{
return __sunxi_factors_register(node, data, lock, reg, CLK_IS_CRITICAL);
}
void sunxi_factors_unregister(struct device_node *node, struct clk *clk)
{
struct clk_hw *hw = __clk_get_hw(clk);