瀏覽代碼

ddr: altera: sdram: Clean up sdram_mmr_init_full() part 8

Fix the return value so that standard errno return values can be used.

Signed-off-by: Marek Vasut <marex@denx.de>
Marek Vasut 9 年之前
父節點
當前提交
99f453e953
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 1
      arch/arm/mach-socfpga/include/mach/sdram.h
  2. 2 1
      drivers/ddr/altera/sdram.c

+ 1 - 1
arch/arm/mach-socfpga/include/mach/sdram.h

@@ -9,7 +9,7 @@
 #ifndef __ASSEMBLY__
 
 unsigned long sdram_calculate_size(void);
-unsigned sdram_mmr_init_full(unsigned int sdr_phy_reg);
+int sdram_mmr_init_full(unsigned int sdr_phy_reg);
 int sdram_calibration_full(void);
 
 extern int sdram_calibration(void);

+ 2 - 1
drivers/ddr/altera/sdram.c

@@ -4,6 +4,7 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 #include <common.h>
+#include <errno.h>
 #include <div64.h>
 #include <watchdog.h>
 #include <asm/arch/fpga_manager.h>
@@ -621,7 +622,7 @@ static void sdr_load_regs(struct socfpga_sdram_config *cfg)
  *
  * Initialize the SDRAM MMR.
  */
-unsigned sdram_mmr_init_full(unsigned int sdr_phy_reg)
+int sdram_mmr_init_full(unsigned int sdr_phy_reg)
 {
 	unsigned long status = 0;
 	struct socfpga_sdram_config *cfg = &sdram_config;