]> git.baikalelectronics.ru Git - kernel.git/commit
clk: at91: clk-generated: Limit the requested rate to our range
authorCodrin Ciubotariu <codrin.ciubotariu@microchip.com>
Wed, 7 Jul 2021 13:12:13 +0000 (16:12 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:25 +0000 (12:26 +0200)
commitb45edbd443974dcad9e9ae896d79d1b73f9bc192
tree0962c9ab191da1f4b853188ab0260c2dbbab55c8
parent1d1ebbfd4857f296bf34f133ee2dae49dd10b704
clk: at91: clk-generated: Limit the requested rate to our range

[ Upstream commit af7651e67b9d5f7e63ea23b118e3672ac662244a ]

On clk_generated_determine_rate(), the requested rate could be outside
of clk's range. Limit the rate to the clock's range to not return an
error.

Fixes: 0696cb2a92fa ("clk: at91: add generated clock driver")
Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Link: https://lore.kernel.org/r/20210707131213.3283509-1-codrin.ciubotariu@microchip.com
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/at91/clk-generated.c