summaryrefslogtreecommitdiffstats
path: root/drivers/ddr/altera/sequencer.c
diff options
context:
space:
mode:
authorMarek Vasut <marex@denx.de>2015-07-18 20:44:28 +0200
committerMarek Vasut <marex@denx.de>2015-08-08 14:14:22 +0200
commit9866824794713dc303f6dd7b8469502ba448d3b3 (patch)
tree471ec62908587989358c5f31758f8a1f05da20fc /drivers/ddr/altera/sequencer.c
parent0113c3e1fef74788d345129184c1569fe35997f0 (diff)
downloadtalos-obmc-uboot-9866824794713dc303f6dd7b8469502ba448d3b3.tar.gz
talos-obmc-uboot-9866824794713dc303f6dd7b8469502ba448d3b3.zip
ddr: altera: Clean up rw_mgr_mem_calibrate_vfifo_center() part 10
Fix the return value of the function to match common convention where 0 means success and negative means error. Fix the return values in case of an error to use errno.h codes. Signed-off-by: Marek Vasut <marex@denx.de>
Diffstat (limited to 'drivers/ddr/altera/sequencer.c')
-rw-r--r--drivers/ddr/altera/sequencer.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ddr/altera/sequencer.c b/drivers/ddr/altera/sequencer.c
index ee541ce16d..efcf28302e 100644
--- a/drivers/ddr/altera/sequencer.c
+++ b/drivers/ddr/altera/sequencer.c
@@ -2264,7 +2264,7 @@ static int rw_mgr_mem_calibrate_vfifo_center(const u32 rank_bgn,
CAL_STAGE_VFIFO_AFTER_WRITES,
CAL_SUBSTAGE_VFIFO_CENTER);
}
- return 0;
+ return -EIO;
}
min_index = get_window_mid_index(0, left_edge, right_edge, &mid_min);
@@ -2319,7 +2319,10 @@ static int rw_mgr_mem_calibrate_vfifo_center(const u32 rank_bgn,
*/
writel(0, &sdr_scc_mgr->update);
- return (dq_margin >= 0) && (dqs_margin >= 0);
+ if ((dq_margin < 0) || (dqs_margin < 0))
+ return -EINVAL;
+
+ return 0;
}
/**
@@ -2459,7 +2462,7 @@ rw_mgr_mem_calibrate_dq_dqs_centering(const u32 rw_group, const u32 test_bgn,
test_bgn,
use_read_test,
update_fom);
- if (ret)
+ if (!ret)
continue;
grp_calibrated = 0;
@@ -2594,7 +2597,7 @@ static uint32_t rw_mgr_mem_calibrate_vfifo_end(uint32_t read_group,
/* Determine if this set of ranks should be skipped entirely */
if (!param->skip_shadow_regs[sr]) {
/* This is the last calibration round, update FOM here */
- if (!rw_mgr_mem_calibrate_vfifo_center(rank_bgn,
+ if (rw_mgr_mem_calibrate_vfifo_center(rank_bgn,
read_group,
test_bgn, 0,
1)) {
OpenPOWER on IntegriCloud