clk: mediatek: mux: Drop unused clock ops
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 25 Jan 2021 17:08:18 +0000 (19:08 +0200)
committerStephen Boyd <sboyd@kernel.org>
Tue, 9 Feb 2021 08:01:28 +0000 (00:01 -0800)
Three out of the four defined clock ops are unused. Drop them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20210125170819.26130-2-laurent.pinchart@ideasonboard.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mediatek/clk-mux.c
drivers/clk/mediatek/clk-mux.h

index dcc1352bf13cf3e120847f5589a815ead7205c75..9370bebca7f8ac8665a18ea5cede25a269b722ab 100644 (file)
@@ -17,23 +17,6 @@ static inline struct mtk_clk_mux *to_mtk_clk_mux(struct clk_hw *hw)
        return container_of(hw, struct mtk_clk_mux, hw);
 }
 
-static int mtk_clk_mux_enable(struct clk_hw *hw)
-{
-       struct mtk_clk_mux *mux = to_mtk_clk_mux(hw);
-       u32 mask = BIT(mux->data->gate_shift);
-
-       return regmap_update_bits(mux->regmap, mux->data->mux_ofs,
-                       mask, ~mask);
-}
-
-static void mtk_clk_mux_disable(struct clk_hw *hw)
-{
-       struct mtk_clk_mux *mux = to_mtk_clk_mux(hw);
-       u32 mask = BIT(mux->data->gate_shift);
-
-       regmap_update_bits(mux->regmap, mux->data->mux_ofs, mask, mask);
-}
-
 static int mtk_clk_mux_enable_setclr(struct clk_hw *hw)
 {
        struct mtk_clk_mux *mux = to_mtk_clk_mux(hw);
@@ -72,28 +55,6 @@ static u8 mtk_clk_mux_get_parent(struct clk_hw *hw)
        return val;
 }
 
-static int mtk_clk_mux_set_parent_lock(struct clk_hw *hw, u8 index)
-{
-       struct mtk_clk_mux *mux = to_mtk_clk_mux(hw);
-       u32 mask = GENMASK(mux->data->mux_width - 1, 0);
-       unsigned long flags = 0;
-
-       if (mux->lock)
-               spin_lock_irqsave(mux->lock, flags);
-       else
-               __acquire(mux->lock);
-
-       regmap_update_bits(mux->regmap, mux->data->mux_ofs, mask,
-               index << mux->data->mux_shift);
-
-       if (mux->lock)
-               spin_unlock_irqrestore(mux->lock, flags);
-       else
-               __release(mux->lock);
-
-       return 0;
-}
-
 static int mtk_clk_mux_set_parent_setclr_lock(struct clk_hw *hw, u8 index)
 {
        struct mtk_clk_mux *mux = to_mtk_clk_mux(hw);
@@ -129,25 +90,7 @@ static int mtk_clk_mux_set_parent_setclr_lock(struct clk_hw *hw, u8 index)
        return 0;
 }
 
-const struct clk_ops mtk_mux_ops = {
-       .get_parent = mtk_clk_mux_get_parent,
-       .set_parent = mtk_clk_mux_set_parent_lock,
-};
-
-const struct clk_ops mtk_mux_clr_set_upd_ops = {
-       .get_parent = mtk_clk_mux_get_parent,
-       .set_parent = mtk_clk_mux_set_parent_setclr_lock,
-};
-
-const struct clk_ops mtk_mux_gate_ops = {
-       .enable = mtk_clk_mux_enable,
-       .disable = mtk_clk_mux_disable,
-       .is_enabled = mtk_clk_mux_is_enabled,
-       .get_parent = mtk_clk_mux_get_parent,
-       .set_parent = mtk_clk_mux_set_parent_lock,
-};
-
-const struct clk_ops mtk_mux_gate_clr_set_upd_ops = {
+static const struct clk_ops mtk_mux_ops = {
        .enable = mtk_clk_mux_enable_setclr,
        .disable = mtk_clk_mux_disable_setclr,
        .is_enabled = mtk_clk_mux_is_enabled,
@@ -171,7 +114,7 @@ static struct clk *mtk_clk_register_mux(const struct mtk_mux *mux,
        init.flags = mux->flags | CLK_SET_RATE_PARENT;
        init.parent_names = mux->parent_names;
        init.num_parents = mux->num_parents;
-       init.ops = mux->ops;
+       init.ops = &mtk_mux_ops;
 
        clk_mux->regmap = regmap;
        clk_mux->data = mux;
index 8e2f927dd2fff521ba34f38774db31241e5f7819..15c62366ba9a3326f093a71d5f9479dfaf3191ce 100644 (file)
@@ -32,19 +32,12 @@ struct mtk_mux {
        u8 gate_shift;
        s8 upd_shift;
 
-       const struct clk_ops *ops;
-
        signed char num_parents;
 };
 
-extern const struct clk_ops mtk_mux_ops;
-extern const struct clk_ops mtk_mux_clr_set_upd_ops;
-extern const struct clk_ops mtk_mux_gate_ops;
-extern const struct clk_ops mtk_mux_gate_clr_set_upd_ops;
-
 #define GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs,         \
                        _mux_set_ofs, _mux_clr_ofs, _shift, _width,     \
-                       _gate, _upd_ofs, _upd, _flags, _ops) {          \
+                       _gate, _upd_ofs, _upd, _flags) {                \
                .id = _id,                                              \
                .name = _name,                                          \
                .mux_ofs = _mux_ofs,                                    \
@@ -58,7 +51,6 @@ extern const struct clk_ops mtk_mux_gate_clr_set_upd_ops;
                .parent_names = _parents,                               \
                .num_parents = ARRAY_SIZE(_parents),                    \
                .flags = _flags,                                        \
-               .ops = &_ops,                                           \
        }
 
 #define MUX_GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs,     \
@@ -66,8 +58,7 @@ extern const struct clk_ops mtk_mux_gate_clr_set_upd_ops;
                        _gate, _upd_ofs, _upd, _flags)                  \
                GATE_CLR_SET_UPD_FLAGS(_id, _name, _parents, _mux_ofs,  \
                        _mux_set_ofs, _mux_clr_ofs, _shift, _width,     \
-                       _gate, _upd_ofs, _upd, _flags,                  \
-                       mtk_mux_gate_clr_set_upd_ops)
+                       _gate, _upd_ofs, _upd, _flags)                  \
 
 #define MUX_GATE_CLR_SET_UPD(_id, _name, _parents, _mux_ofs,           \
                        _mux_set_ofs, _mux_clr_ofs, _shift, _width,     \