Patchwork [U-Boot,v2,batch,1,03/10] powerpc/85xx: add SerDes bank 4 lanes only if we have a bank 4

login
register
mail settings
Submitter York Sun
Date March 25, 2013, 5:30 p.m.
Message ID <1364232615-30719-3-git-send-email-yorksun@freescale.com>
Download mbox | patch
Permalink /patch/230766/
State Accepted, archived
Delegated to: Andy Fleming
Headers show

Comments

York Sun - March 25, 2013, 5:30 p.m.
From: Timur Tabi <timur@tabi.org>

Only some chips have four SerDes banks, so don't define lanes for a bank
that doesn't exist.

This fixes warning message "excess elements in array initializer" for
array lanes[], because that array is defined with a size of SRDS_MAX_LANES,
and the value of SRDS_MAX_LANES depends on the number of SerDes banks.

Signed-off-by: Timur Tabi <timur@tabi.org>
---
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |    4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
index 5495dc5..00e1c11 100644
--- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
@@ -103,6 +103,10 @@  static const struct {
 	{ 22, 168, FSL_SRDS_BANK_3 },
 	{ 23, 169, FSL_SRDS_BANK_3 },
 #endif
+#if SRDS_MAX_BANK > 3
+	{ 24, 175, FSL_SRDS_BANK_4 },
+	{ 25, 176, FSL_SRDS_BANK_4 },
+#endif
 };
 
 int serdes_get_lane_idx(int lane)