ARM: uniphier: fix build error when CONFIG_CMD_DDRMPHY_DUMP=y
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 4 Mar 2016 06:54:29 +0000 (15:54 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 8 Mar 2016 16:10:47 +0000 (01:10 +0900)
The build fails if compiled with CONFIG_CMD_DDRMPHY_DUMP=y since commit
46abfcc99e04 ("ARM: uniphier: rework struct uniphier_board_data").

Fixes: 46abfcc99e04 ("ARM: uniphier: rework struct uniphier_board_data")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/mach-uniphier/dram/cmd_ddrmphy.c

index c18f099f2c008478396a5effe83b9002a9d9cc2c..7ac93786be632375d57e140975a0d3a6d31b385d 100644 (file)
@@ -28,28 +28,14 @@ static int get_nr_ch(void)
 {
        const struct uniphier_board_data *bd = uniphier_get_board_param();
 
-       return bd->dram_ch2_width ? 3 : 2;
+       return bd->dram_ch[2].size ? 3 : 2;
 }
 
 static int get_nr_datx8(int ch)
 {
-       unsigned int width;
-
        const struct uniphier_board_data *bd = uniphier_get_board_param();
 
-       switch (ch) {
-       case 0:
-               width = bd->dram_ch0_width;
-               break;
-       case 1:
-               width = bd->dram_ch1_width;
-               break;
-       default:
-               width = bd->dram_ch2_width;
-               break;
-       }
-
-       return width / 8;
+       return bd->dram_ch[ch].width / 8;
 }
 
 static void print_bdl(void __iomem *reg, int n)