From: Robert Marko Date: Wed, 28 Oct 2020 12:56:25 +0000 (+0100) Subject: IPQ40xx: clk: dont always return 0 X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=20476b51aa4d77c774f14671a185b5ac94f86c49;p=u-boot.git IPQ40xx: clk: dont always return 0 Currently the driver will go through the clock ID-s and set/enable them as needed. But if the ID is unknown it will fall through the switch case to the default case which will always return 0. This is not correct and default cases should return a error code since clock ID is unknown. So lets return -EINVAL instead. Signed-off-by: Robert Marko Cc: Luka Perkov --- diff --git a/arch/arm/mach-ipq40xx/clock-ipq4019.c b/arch/arm/mach-ipq40xx/clock-ipq4019.c index ac2b830353..7308563ad1 100644 --- a/arch/arm/mach-ipq40xx/clock-ipq4019.c +++ b/arch/arm/mach-ipq40xx/clock-ipq4019.c @@ -26,7 +26,7 @@ ulong msm_set_rate(struct clk *clk, ulong rate) /* This clock is already initialized by SBL1 */ return 0; default: - return 0; + return -EINVAL; } } @@ -56,7 +56,7 @@ static int msm_enable(struct clk *clk) /* This clock is already initialized by SBL1 */ return 0; default: - return 0; + return -EINVAL; } }