clk: vc5: Use `clamp()` to restrict PLL range
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 14 Jan 2023 23:34:58 +0000 (15:34 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Jul 2023 14:21:16 +0000 (16:21 +0200)
commit548b67c0aad4a50988e4ad11e071c523e41e6358
tree47c5572ab2f594d04e7f1371403a21784e90921d
parent50fb32197f60333666dac9ae23aa107d2c9ad8ba
clk: vc5: Use `clamp()` to restrict PLL range

[ Upstream commit 3ed741db04f58e8df0d46cec7ecfc4bfd075f047 ]

The VCO frequency needs to be within a certain range and the driver
enforces this.

Make use of the clamp macro to implement this instead of open-coding it.
This makes the code a bit shorter and also semanticly stronger.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20230114233500.3294789-1-lars@metafoo.de
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Stable-dep-of: be3471c5bd9b ("clk: vc5: Fix .driver_data content in i2c_device_id")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/clk-versaclock5.c