Skip to contentSkip to conversation

mx28evk: Propagate the error if cpu_eth_init() fails

PATCH New Fabio Estevam 3 participants 8 messages Sep 20, 2013 – Sep 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mx28evk: Propagate the error if cpu_eth_init() fails

From: Fabio Estevam <[email protected]>

If cpu_eth_init() fails we should return the error immediately.

---
 board/freescale/mx28evk/mx28evk.c | 2 ++
 1 file changed, 2 insertions(+)
board/freescale/mx28evk/mx28evk.c +2 -0
index 3abf1fd..5005fe2 100644
@@ -103,6 +103,8 @@ int board_eth_init(bd_t *bis)
 	int ret;
 
 	ret = cpu_eth_init(bis);
+	if (ret)
+		return ret;
 
 	/* MX28EVK uses ENET_CLK PAD to drive FEC clock */
 	writel(CLKCTRL_ENET_TIME_SEL_RMII_CLK | CLKCTRL_ENET_CLK_OUT_EN,
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/3 mx28evk: Propagate the error if cpu_eth_init() fails

From: Fabio Estevam <[email protected]>

If cpu_eth_init() fails we should return the error immediately.

---
 board/denx/m28evk/m28evk.c | 2 ++
 1 file changed, 2 insertions(+)
board/denx/m28evk/m28evk.c +2 -0
index f4453d6..33d38cf 100644
@@ -116,6 +116,8 @@ int board_eth_init(bd_t *bis)
 	int ret;
 
 	ret = cpu_eth_init(bis);
+	if (ret)
+		return ret;
 
 	clrsetbits_le32(&clkctrl_regs->hw_clkctrl_enet,
 		CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 2/3 mx28evk: Propagate the error if cpu_eth_init() fails

Dear Fabio Estevam,

Quoted 6 lines

From: Fabio Estevam <[email protected]>

If cpu_eth_init() fails we should return the error immediately.

Quoted 9 lines
---
 board/denx/m28evk/m28evk.c | 2 ++
 1 file changed, 2 insertions(+)
board/denx/m28evk/m28evk.c +0 -0
index f4453d6..33d38cf 100644

board/denx/m28evk/m28evk.c int board_eth_init(bd_t *bis) · line 123

Quoted 8 lines
board/denx/m28evk/m28evk.c +2 -0
@@ -116,6 +116,8 @@ int board_eth_init(bd_t *bis)
 	int ret;
 
 	ret = cpu_eth_init(bis);
+	if (ret)
+		return ret;
 
 	clrsetbits_le32(&clkctrl_regs->hw_clkctrl_enet,
 		CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,

Best regards,
Marek Vasut

#3 lore raw

PATCH 2/3 mx28evk: Propagate the error if cpu_eth_init() fails

In reply to Fabio Estevam
Quoted 7 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

If cpu_eth_init() fails we should return the error immediately.

---

Applied to u-boot-imx (fix), thanks!

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#4 lore raw

PATCH 3/3 mx35pdk: Fix error handling in board_late_init()

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

If smc911x_initialize() fails we should return the error immediately.

While at it, also check the error from cpu_eth_init().

---
 board/freescale/mx35pdk/mx35pdk.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
board/freescale/mx35pdk/mx35pdk.c +4 -6
index 427c83a..9fabef5 100644
@@ -251,14 +251,12 @@ int board_late_init(void)
 
 int board_eth_init(bd_t *bis)
 {
-	int rc = -ENODEV;
 #if defined(CONFIG_SMC911X)
-	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+	int rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+	if (rc)
+		return rc;
 #endif
-
-	cpu_eth_init(bis);
-
-	return rc;
+	return cpu_eth_init(bis);
 }
 
 #if defined(CONFIG_FSL_ESDHC)
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH 3/3 mx35pdk: Fix error handling in board_late_init()

Quoted 25 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

If smc911x_initialize() fails we should return the error immediately.

While at it, also check the error from cpu_eth_init().

---
 board/freescale/mx35pdk/mx35pdk.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
board/freescale/mx35pdk/mx35pdk.c +2 -2
index 427c83a..9fabef5 100644
@@ -251,14 +251,12 @@ int board_late_init(void)
 
 int board_eth_init(bd_t *bis)
 {
-	int rc = -ENODEV;
 #if defined(CONFIG_SMC911X)
-	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+	int rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+	if (rc)

board/freescale/mx35pdk/mx35pdk.c int board_late_init(void) · line 262

Quoted 10 lines
board/freescale/mx35pdk/mx35pdk.c +2 -4
+		return rc;
 #endif
-
-	cpu_eth_init(bis);
-
-	return rc;
+	return cpu_eth_init(bis);
 }
 
 #if defined(CONFIG_FSL_ESDHC)

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#6 lore raw

PATCH 3/3 mx35pdk: Fix error handling in board_late_init()

In reply to Fabio Estevam
Quoted 8 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

If smc911x_initialize() fails we should return the error immediately.

While at it, also check the error from cpu_eth_init().

---

Applied to u-boot-imx (fix), thanks!

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#7 lore raw

PATCH 1/3 mx28evk: Propagate the error if cpu_eth_init() fails

In reply to Fabio Estevam
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

If cpu_eth_init() fails we should return the error immediately.

---

Applied to u-boot-imx (fix), thanks!

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================