aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/clk-gate2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/clk-gate2.c')
-rw-r--r--arch/arm/mach-imx/clk-gate2.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/clk-gate2.c b/arch/arm/mach-imx/clk-gate2.c
index 84acdfd1d715..5a75cdc81891 100644
--- a/arch/arm/mach-imx/clk-gate2.c
+++ b/arch/arm/mach-imx/clk-gate2.c
@@ -97,7 +97,7 @@ static int clk_gate2_is_enabled(struct clk_hw *hw)
97 struct clk_gate2 *gate = to_clk_gate2(hw); 97 struct clk_gate2 *gate = to_clk_gate2(hw);
98 98
99 if (gate->share_count) 99 if (gate->share_count)
100 return !!(*gate->share_count); 100 return !!__clk_get_enable_count(hw->clk);
101 else 101 else
102 return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx); 102 return clk_gate2_reg_is_enabled(gate->reg, gate->bit_idx);
103} 103}
@@ -127,10 +127,6 @@ struct clk *clk_register_gate2(struct device *dev, const char *name,
127 gate->bit_idx = bit_idx; 127 gate->bit_idx = bit_idx;
128 gate->flags = clk_gate2_flags; 128 gate->flags = clk_gate2_flags;
129 gate->lock = lock; 129 gate->lock = lock;
130
131 /* Initialize share_count per hardware state */
132 if (share_count)
133 *share_count = clk_gate2_reg_is_enabled(reg, bit_idx) ? 1 : 0;
134 gate->share_count = share_count; 130 gate->share_count = share_count;
135 131
136 init.name = name; 132 init.name = name;