aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Jones <lee@kernel.org>2022-08-11 08:58:46 +0100
committerKever Yang <kever.yang@rock-chips.com>2022-09-04 20:00:38 +0800
commit7b561e2ab8ac980023c5e5325f45a8ca1951c0dd (patch)
tree40d7e939e277f3fe80517a6bc14436182c8e4ffc
parentfc1526f651a557ddbf7c3cba8575be963573871f (diff)
downloadu-boot-7b561e2ab8ac980023c5e5325f45a8ca1951c0dd.zip
u-boot-7b561e2ab8ac980023c5e5325f45a8ca1951c0dd.tar.gz
u-boot-7b561e2ab8ac980023c5e5325f45a8ca1951c0dd.tar.bz2
ram: rk3399: Fix .set_rate_index() error handling
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>
-rw-r--r--drivers/ram/rockchip/sdram_rk3399.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/ram/rockchip/sdram_rk3399.c b/drivers/ram/rockchip/sdram_rk3399.c
index 8b4d525..5faff39 100644
--- a/drivers/ram/rockchip/sdram_rk3399.c
+++ b/drivers/ram/rockchip/sdram_rk3399.c
@@ -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;