Skip to content

Commit c2f3098

Browse files
Chunyan Zhangbebarino
authored andcommitted
clk: sprd: return correct type of value for _sprd_pll_recalc_rate
The function _sprd_pll_recalc_rate() defines return value to unsigned long, but it would return a negative value when malloc fail, changing to return its parent_rate makes more sense, since if the callback .recalc_rate() is not set, the framework returns the parent_rate as well. Fixes: 3e37b00 ("clk: sprd: add adjustable pll support") Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Link: https://lkml.kernel.org/r/20200519030036.1785-2-zhang.lyra@gmail.com Reviewed-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 3aff9b5 commit c2f3098

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/clk/sprd/pll.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static unsigned long _sprd_pll_recalc_rate(const struct sprd_pll *pll,
106106

107107
cfg = kcalloc(regs_num, sizeof(*cfg), GFP_KERNEL);
108108
if (!cfg)
109-
return -ENOMEM;
109+
return parent_rate;
110110

111111
for (i = 0; i < regs_num; i++)
112112
cfg[i] = sprd_pll_read(pll, i);

0 commit comments

Comments
 (0)