ARM: OMAP1: clock: Fix UART rate reporting algorithm
authorJanusz Krzysztofik <jmkrzyszt@gmail.com>
Sun, 10 Apr 2022 13:07:54 +0000 (15:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:53:46 +0000 (16:53 +0200)
[ Upstream commit 338d5d476cde853dfd97378d20496baabc2ce3c0 ]

Since its introduction to the mainline kernel, omap1_uart_recalc() helper
makes incorrect use of clk->enable_bit as a ready to use bitmap mask while
it only provides the bit number.  Fix it.

Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mach-omap1/clock.c

index fa512413a47172212483ebec6811bc5547aa729b..b277409f303ac6213d2c05863f4e54e590834d16 100644 (file)
@@ -44,7 +44,7 @@ static DEFINE_SPINLOCK(clockfw_lock);
 unsigned long omap1_uart_recalc(struct clk *clk)
 {
        unsigned int val = __raw_readl(clk->enable_reg);
-       return val & clk->enable_bit ? 48000000 : 12000000;
+       return val & 1 << clk->enable_bit ? 48000000 : 12000000;
 }
 
 unsigned long omap1_sossi_recalc(struct clk *clk)