Skip to content

Commit

Permalink
clk: sunxi-ng: a80: fix the zero'ing of bits 16 and 18
Browse files Browse the repository at this point in the history
The zero'ing of bits 16 and 18 is incorrect. Currently the code
is masking with the bitwise-and of BIT(16) & BIT(18) which is
0, so the updated value for val is always zero. Fix this by bitwise
and-ing value with the correct mask that will zero bits 16 and 18.

Addresses-Coverity: (" Suspicious &= or |= constant expression")
Fixes: b8eb71d ("clk: sunxi-ng: Add A80 CCU")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
  • Loading branch information
Colin Ian King authored and Maxime Ripard committed Oct 29, 2019
1 parent afdc74e commit cdfc2e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/sunxi-ng/ccu-sun9i-a80.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ static int sun9i_a80_ccu_probe(struct platform_device *pdev)

/* Enforce d1 = 0, d2 = 0 for Audio PLL */
val = readl(reg + SUN9I_A80_PLL_AUDIO_REG);
val &= (BIT(16) & BIT(18));
val &= ~(BIT(16) | BIT(18));
writel(val, reg + SUN9I_A80_PLL_AUDIO_REG);

/* Enforce P = 1 for both CPU cluster PLLs */
Expand Down

0 comments on commit cdfc2e2

Please sign in to comment.