clk: sunxi-ng: nm: Check if requested rate is supported by fractional clock
authorChen-Yu Tsai <wens@csie.org>
Thu, 12 Oct 2017 08:36:58 +0000 (16:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:26:24 +0000 (14:26 +0100)
commita7455b113feff0b99cad533c63bc6b877c1a1960
tree58bc65615c119befd088e2a513df8bf8305a4edd
parent5d583a7e2d92a723e9833604f760517a64f630cc
clk: sunxi-ng: nm: Check if requested rate is supported by fractional clock

[ Upstream commit 4cdbc40d64d4b8303a97e29a52862e4d99502beb ]

The round_rate callback for N-M-factor style clocks does not check if
the requested clock rate is supported by the fractional clock mode.
While this doesn't affect usage in practice, since the clock rates
are also supported through N-M factors, it does not match the set_rate
code.

Add a check to the round_rate callback so it matches the set_rate
callback.

Fixes: 6174a1e24b0d ("clk: sunxi-ng: Add N-M-factor clock support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/sunxi-ng/ccu_nm.c