diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2021-03-26 13:00:56 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2021-05-11 09:57:06 +0200 |
commit | c141897caafb4754b6ef862a67c87b8feed4d921 (patch) | |
tree | 5c1096dfcf3b11476d9f1bb395df92402af25e5b /drivers/clk/renesas/rcar-gen3-cpg.c | |
parent | 58effcd350c81735154313aa49b1c0801fdb04a2 (diff) | |
download | linux-stable-c141897caafb4754b6ef862a67c87b8feed4d921.tar.gz linux-stable-c141897caafb4754b6ef862a67c87b8feed4d921.tar.bz2 linux-stable-c141897caafb4754b6ef862a67c87b8feed4d921.zip |
clk: renesas: rcar-gen3: Remove superfluous masking in cpg_z_clk_set_rate()
Due to the clamping of mult, "(32 - mult) << __ffs(zclk->mask)" can
never exceed the mask.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Link: https://lore.kernel.org/r/20210326120100.1577596-4-geert+renesas@glider.be
Diffstat (limited to 'drivers/clk/renesas/rcar-gen3-cpg.c')
-rw-r--r-- | drivers/clk/renesas/rcar-gen3-cpg.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar-gen3-cpg.c index e5edf1b90841..cf0d049aa8c7 100644 --- a/drivers/clk/renesas/rcar-gen3-cpg.c +++ b/drivers/clk/renesas/rcar-gen3-cpg.c @@ -104,8 +104,7 @@ static int cpg_z_clk_set_rate(struct clk_hw *hw, unsigned long rate, if (readl(zclk->kick_reg) & CPG_FRQCRB_KICK) return -EBUSY; - cpg_reg_modify(zclk->reg, zclk->mask, - ((32 - mult) << __ffs(zclk->mask)) & zclk->mask); + cpg_reg_modify(zclk->reg, zclk->mask, (32 - mult) << __ffs(zclk->mask)); /* * Set KICK bit in FRQCRB to update hardware setting and wait for |