clk: move the common clock's to_clk_*(_hw) macros to clk-provider.h
to_clk_*(_hw) macros have been repeatedly defined in many places. This patch moves all the to_clk_*(_hw) definitions in the common clock framework to public header clk-provider.h, and drop the local definitions. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:

committed by
Stephen Boyd

parent
f9285b54d6
commit
5fd9c05c84
@@ -38,7 +38,7 @@ struct clk_busy_divider {
|
||||
|
||||
static inline struct clk_busy_divider *to_clk_busy_divider(struct clk_hw *hw)
|
||||
{
|
||||
struct clk_divider *div = container_of(hw, struct clk_divider, hw);
|
||||
struct clk_divider *div = to_clk_divider(hw);
|
||||
|
||||
return container_of(div, struct clk_busy_divider, div);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ struct clk_busy_mux {
|
||||
|
||||
static inline struct clk_busy_mux *to_clk_busy_mux(struct clk_hw *hw)
|
||||
{
|
||||
struct clk_mux *mux = container_of(hw, struct clk_mux, hw);
|
||||
struct clk_mux *mux = to_clk_mux(hw);
|
||||
|
||||
return container_of(mux, struct clk_busy_mux, mux);
|
||||
}
|
||||
|
@@ -15,7 +15,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include "clk.h"
|
||||
|
||||
#define to_clk_div(_hw) container_of(_hw, struct clk_divider, hw)
|
||||
#define div_mask(d) ((1 << (d->width)) - 1)
|
||||
|
||||
/**
|
||||
@@ -35,7 +34,7 @@ struct clk_fixup_div {
|
||||
|
||||
static inline struct clk_fixup_div *to_clk_fixup_div(struct clk_hw *hw)
|
||||
{
|
||||
struct clk_divider *divider = to_clk_div(hw);
|
||||
struct clk_divider *divider = to_clk_divider(hw);
|
||||
|
||||
return container_of(divider, struct clk_fixup_div, divider);
|
||||
}
|
||||
@@ -60,7 +59,7 @@ static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long parent_rate)
|
||||
{
|
||||
struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
|
||||
struct clk_divider *div = to_clk_div(hw);
|
||||
struct clk_divider *div = to_clk_divider(hw);
|
||||
unsigned int divider, value;
|
||||
unsigned long flags = 0;
|
||||
u32 val;
|
||||
|
@@ -15,8 +15,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include "clk.h"
|
||||
|
||||
#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
|
||||
|
||||
/**
|
||||
* struct clk_fixup_mux - imx integer fixup multiplexer clock
|
||||
* @mux: the parent class
|
||||
|
@@ -31,7 +31,7 @@ struct clk_gate_exclusive {
|
||||
|
||||
static int clk_gate_exclusive_enable(struct clk_hw *hw)
|
||||
{
|
||||
struct clk_gate *gate = container_of(hw, struct clk_gate, hw);
|
||||
struct clk_gate *gate = to_clk_gate(hw);
|
||||
struct clk_gate_exclusive *exgate = container_of(gate,
|
||||
struct clk_gate_exclusive, gate);
|
||||
u32 val = readl(gate->reg);
|
||||
|
Reference in New Issue
Block a user