diff options
author | Marek Vasut <marex@denx.de> | 2015-07-21 05:32:49 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-08-08 14:14:23 +0200 |
commit | d043ee5b4964481b529e8ee118598e5aedc902da (patch) | |
tree | d29c8c9554501b8bd6753e37d29059324dae2a98 /drivers/ddr | |
parent | c65408720670819a9a7174a6b0ed59968cd8ffb7 (diff) |
ddr: altera: Clean up rw_mgr_mem_calibrate_writes_center() part 4
Fix return values to match the common return value convention.
Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/ddr')
-rw-r--r-- | drivers/ddr/altera/sequencer.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/ddr/altera/sequencer.c b/drivers/ddr/altera/sequencer.c index 986f0889f2..9cf2a1ad68 100644 --- a/drivers/ddr/altera/sequencer.c +++ b/drivers/ddr/altera/sequencer.c @@ -3024,7 +3024,7 @@ rw_mgr_mem_calibrate_writes_center(const u32 rank_bgn, const u32 write_group, if (ret) { set_failing_group_stage(test_bgn + ret - 1, CAL_STAGE_WRITES, CAL_SUBSTAGE_WRITES_CENTER); - return 0; + return -EINVAL; } min_index = get_window_mid_index(1, left_edge, right_edge, &mid_min); @@ -3121,7 +3121,10 @@ rw_mgr_mem_calibrate_writes_center(const u32 rank_bgn, const u32 write_group, */ writel(0, &sdr_scc_mgr->update); - return (dq_margin >= 0) && (dqs_margin >= 0) && (dm_margin >= 0); + if ((dq_margin < 0) || (dqs_margin < 0) || (dm_margin < 0)) + return -EINVAL; + + return 0; } /** @@ -3148,13 +3151,11 @@ static int rw_mgr_mem_calibrate_writes(const u32 rank_bgn, const u32 group, reg_file_set_sub_stage(CAL_SUBSTAGE_WRITES_CENTER); ret = rw_mgr_mem_calibrate_writes_center(rank_bgn, group, test_bgn); - if (!ret) { + if (ret) set_failing_group_stage(group, CAL_STAGE_WRITES, CAL_SUBSTAGE_WRITES_CENTER); - return -EIO; - } - return 0; + return ret; } /** |