ram: rk3399: Handle pctl_cfg return type
authorJagan Teki <jagan@amarulasolutions.com>
Mon, 15 Jul 2019 18:20:59 +0000 (23:50 +0530)
committerKever Yang <kever.yang@rock-chips.com>
Fri, 19 Jul 2019 03:11:09 +0000 (11:11 +0800)
Add proper return type handling of pctl_cfg with
meaningful print statement.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <Kever.yang@rock-chips.com>
drivers/ram/rockchip/sdram_rk3399.c

index c918c2e588a23ac218a37a527f108c0b5b8ab74d..de5d8c1b5fd47e0eee7395c507b19eee57aa4a14 100644 (file)
@@ -1063,6 +1063,7 @@ static int sdram_init(struct dram_info *dram,
        unsigned char dramtype = params->base.dramtype;
        unsigned int ddr_freq = params->base.ddr_freq;
        int channel;
+       int ret;
 
        debug("Starting SDRAM initialization...\n");
 
@@ -1082,9 +1083,10 @@ static int sdram_init(struct dram_info *dram,
                if (channel >= params->base.num_channels)
                        continue;
 
-               if (pctl_cfg(chan, channel, params) != 0) {
-                       printf("pctl_cfg fail, reset\n");
-                       return -EIO;
+               ret = pctl_cfg(chan, channel, params);
+               if (ret < 0) {
+                       printf("%s: pctl config failed\n", __func__);
+                       return ret;
                }
 
                /* LPDDR2/LPDDR3 need to wait DAI complete, max 10us */