clk: mediatek: clk-gate: Use regmap_{set/clear}_bits helpers
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 3 Jan 2022 14:37:12 +0000 (15:37 +0100)
committerStephen Boyd <sboyd@kernel.org>
Fri, 7 Jan 2022 02:27:10 +0000 (18:27 -0800)
Appropriately change calls to regmap_update_bits() with regmap_set_bits()
and regmap_clear_bits() for improved readability.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20220103143712.46675-2-angelogioacchino.delregno@collabora.com
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/mediatek/clk-gate.c

index 957fa1d68f079d7edb0f8680b5ca10330acfb408..5d88b428565b56bd3023c3666c4d123a3c275784 100644 (file)
@@ -53,17 +53,15 @@ static void mtk_cg_clr_bit(struct clk_hw *hw)
 static void mtk_cg_set_bit_no_setclr(struct clk_hw *hw)
 {
        struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
-       u32 cgbit = BIT(cg->bit);
 
-       regmap_update_bits(cg->regmap, cg->sta_ofs, cgbit, cgbit);
+       regmap_set_bits(cg->regmap, cg->sta_ofs, BIT(cg->bit));
 }
 
 static void mtk_cg_clr_bit_no_setclr(struct clk_hw *hw)
 {
        struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
-       u32 cgbit = BIT(cg->bit);
 
-       regmap_update_bits(cg->regmap, cg->sta_ofs, cgbit, 0);
+       regmap_clear_bits(cg->regmap, cg->sta_ofs, BIT(cg->bit));
 }
 
 static int mtk_cg_enable(struct clk_hw *hw)