diff options
author | Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> | 2023-09-12 07:51:31 +0300 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2023-09-18 10:05:02 +0200 |
commit | becf4a771a12b52dc5b3d2b089598d5603f3bbec (patch) | |
tree | 234e1042505825a5cdc0a9fb58cc582add0916e4 /drivers/clk | |
parent | 17939df3c9acd26e4dac1c5943dd8e58e1bcb4e7 (diff) |
clk: renesas: rzg2l: Simplify the logic in rzg2l_mod_clock_endisable()
The bitmask << 16 is anyway set on both branches of if thus move it
before the if and set the lower bits of registers only in case clock is
enabled.
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230912045157.177966-12-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/renesas/rzg2l-cpg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c index a1e820d2eb9e..115e19823b70 100644 --- a/drivers/clk/renesas/rzg2l-cpg.c +++ b/drivers/clk/renesas/rzg2l-cpg.c @@ -909,10 +909,9 @@ static int rzg2l_mod_clock_endisable(struct clk_hw *hw, bool enable) enable ? "ON" : "OFF"); spin_lock_irqsave(&priv->rmw_lock, flags); + value = bitmask << 16; if (enable) - value = (bitmask << 16) | bitmask; - else - value = bitmask << 16; + value |= bitmask; writel(value, priv->base + CLK_ON_R(reg)); spin_unlock_irqrestore(&priv->rmw_lock, flags); |