OpenCloudOS-Kernel/drivers/clk/sprd
Stephen Boyd 587dd448d9 clk: sprd: composite: Simplify determine_rate implementation
The sprd_div_helper_round_rate() function calls divider_round_rate()
which calls divider_round_rate_parent() which calls
divider_determine_rate(). This call chain converts back and forth from
the rate request structure to make a determine_rate clk_op fit with a
round_rate clk_op. Simplify the code here by directly calling
divider_determine_rate() instead.

This fixes a smatch warning where an unsigned long is compared to less
than zero, which is impossible. This makes sprd_div_helper_round_rate()
unnecessary as well so simply remove it and fold it into the only caller
left.

Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Closes: https://lore.kernel.org/r/45fdc54e-7ab6-edd6-d55a-473485608473@oracle.com
Cc: Maxime Ripard <maxime@cerno.tech>
Fixes: 302d2f836d ("clk: sprd: composite: Switch to determine_rate")
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20230613195443.1555132-1-sboyd@kernel.org
Reviewed-by: Maxime Ripard <mripard@kernel.org>
2023-06-14 12:43:26 -07:00
..
Kconfig clk: sprd: Add dependency for SPRD_UMS512_CLK 2023-02-10 16:13:48 -08:00
Makefile clk: sprd: Add clocks support for UMS512 2022-09-30 12:22:19 -07:00
common.c Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
common.h clk: sprd: Use the correct style for SPDX License Identifier 2019-05-01 13:01:23 -07:00
composite.c clk: sprd: composite: Simplify determine_rate implementation 2023-06-14 12:43:26 -07:00
composite.h clk: sprd: Add macros for referencing parents without strings 2020-03-24 19:03:57 -07:00
div.c clk: sprd: composite: Simplify determine_rate implementation 2023-06-14 12:43:26 -07:00
div.h clk: sprd: composite: Simplify determine_rate implementation 2023-06-14 12:43:26 -07:00
gate.c clk: sprd: check its parent status before reading gate clock 2020-05-26 23:41:14 -07:00
gate.h clk: sprd: check its parent status before reading gate clock 2020-05-26 23:41:14 -07:00
mux.c
mux.h clk: sprd: Add macros for referencing parents without strings 2020-03-24 19:03:57 -07:00
pll.c clk: sprd: return correct type of value for _sprd_pll_recalc_rate 2020-05-26 20:14:56 -07:00
pll.h clk: sprd: Add macros for referencing parents without strings 2020-03-24 19:03:57 -07:00
sc9860-clk.c clk: sprd: Add check for return value of sprd_clk_regmap_init() 2019-06-27 15:08:29 -07:00
sc9863a-clk.c This time around we have 4 lines of diff in the core framework, removing a 2020-06-10 11:42:19 -07:00
ums512-clk.c clk: sprd: Add clocks support for UMS512 2022-09-30 12:22:19 -07:00