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>
This commit is contained in:
Lee Jones 2022-08-11 08:58:46 +01:00 committed by Kever Yang
parent fc1526f651
commit 7b561e2ab8

View 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;