]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ram: rk3399: Fix .set_rate_index() error handling
authorLee Jones <lee@kernel.org>
Thu, 11 Aug 2022 07:58:46 +0000 (08:58 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Sun, 4 Sep 2022 12:00:38 +0000 (20:00 +0800)
Functions pointed to by this op pointer can return non-zero values
indicating an error.  Ensure any error value is propagated back up the
call-chain.

Signed-off-by: Lee Jones <lee@kernel.org>
Tested-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
drivers/ram/rockchip/sdram_rk3399.c

index 8b4d52529244201ce706773331b6e63bbf336931..5faff396410cd790183602279f4390e96533af45 100644 (file)
@@ -3005,7 +3005,9 @@ static int sdram_init(struct dram_info *dram,
        params->base.stride = calculate_stride(params);
        dram_all_config(dram, params);
 
-       dram->ops->set_rate_index(dram, params);
+       ret = dram->ops->set_rate_index(dram, params);
+       if (ret)
+               return ret;
 
        debug("Finish SDRAM initialization...\n");
        return 0;