Skip to content

Commit becf4a7

Browse files
claudiubezneageertu
authored andcommitted
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 <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 17939df commit becf4a7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/clk/renesas/rzg2l-cpg.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -909,10 +909,9 @@ static int rzg2l_mod_clock_endisable(struct clk_hw *hw, bool enable)
909909
enable ? "ON" : "OFF");
910910
spin_lock_irqsave(&priv->rmw_lock, flags);
911911

912+
value = bitmask << 16;
912913
if (enable)
913-
value = (bitmask << 16) | bitmask;
914-
else
915-
value = bitmask << 16;
914+
value |= bitmask;
916915
writel(value, priv->base + CLK_ON_R(reg));
917916

918917
spin_unlock_irqrestore(&priv->rmw_lock, flags);

0 commit comments

Comments
 (0)