Skip to content

Commit 0a9c869

Browse files
Gabriel-Fernandez-stmbebarino
authored andcommitted
clk: gate: expose clk_gate_ops::is_enabled
This patch exposes clk_gate_ops::is_enabled as functions that can be directly called and assigned in places like this so we don't need wrapper functions that do nothing besides forward the call. Signed-off-by: Gabriel Fernandez <[email protected]> Suggested-by: Stephen Boyd <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 42d3c5f commit 0a9c869

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

drivers/clk/clk-gate.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static void clk_gate_disable(struct clk_hw *hw)
8686
clk_gate_endisable(hw, 0);
8787
}
8888

89-
static int clk_gate_is_enabled(struct clk_hw *hw)
89+
int clk_gate_is_enabled(struct clk_hw *hw)
9090
{
9191
u32 reg;
9292
struct clk_gate *gate = to_clk_gate(hw);
@@ -101,6 +101,7 @@ static int clk_gate_is_enabled(struct clk_hw *hw)
101101

102102
return reg ? 1 : 0;
103103
}
104+
EXPORT_SYMBOL_GPL(clk_gate_is_enabled);
104105

105106
const struct clk_ops clk_gate_ops = {
106107
.enable = clk_gate_enable,

include/linux/clk-provider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ struct clk_hw *clk_hw_register_gate(struct device *dev, const char *name,
343343
u8 clk_gate_flags, spinlock_t *lock);
344344
void clk_unregister_gate(struct clk *clk);
345345
void clk_hw_unregister_gate(struct clk_hw *hw);
346+
int clk_gate_is_enabled(struct clk_hw *hw);
346347

347348
struct clk_div_table {
348349
unsigned int val;

0 commit comments

Comments
 (0)