clk: qcom: clk-krait: fix wrong div2 functions
authorChristian Marangi <ansuelsmth@gmail.com>
Tue, 8 Nov 2022 21:56:25 +0000 (22:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:15 +0000 (13:14 +0100)
commita051e10bfc6906d29dae7a31f0773f2702edfe1b
treef709941a8209a2e609be526692f1f9749309ca96
parent8275c7465d9e253b2030698ba93e9de6851412ff
clk: qcom: clk-krait: fix wrong div2 functions

[ Upstream commit d676d3a3717cf726d3affedbe5ba98fc4ccad7b3 ]

Currently div2 value is applied to the wrong bits. This is caused by a
bug in the code where the shift is done only for lpl, for anything
else the mask is not shifted to the correct bits.

Fix this by correctly shift if lpl is not supported.

Fixes: 4d7dc77babfe ("clk: qcom: Add support for Krait clocks")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221108215625.30186-1-ansuelsmth@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/qcom/clk-krait.c