Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: tegra: fix error return case for recalc_rate

tegra-bpmp clocks driver makes implicit conversion of signed error
code to unsigned value in recalc_rate operation. The behavior for
recalc_rate, according to it's specification, should be that "If the
driver cannot figure out a rate for this clock, it must return 0."

Fixes: ca6f2796eef7 ("clk: tegra: Add BPMP clock driver")
Signed-off-by: Timo Alho <talho@nvidia.com>
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Link: https://lore.kernel.org/r/20230912112951.2330497-1-cyndis@kapsi.fi
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Timo Alho and committed by
Stephen Boyd
a47b44fb 83df5bf0

+1 -1
+1 -1
drivers/clk/tegra/clk-bpmp.c
··· 159 159 160 160 err = tegra_bpmp_clk_transfer(clk->bpmp, &msg); 161 161 if (err < 0) 162 - return err; 162 + return 0; 163 163 164 164 return response.rate; 165 165 }