Skip to contentSkip to conversation

wandboard: Return from cpu_eth_init() directly

PATCH New Fabio Estevam 3 participants 8 messages Jan 4, 2014 – Jan 13, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/6 wandboard: Return from cpu_eth_init() directly

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

---
Changes since v1:
- None

 board/wandboard/wandboard.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
board/wandboard/wandboard.c +1 -7
index 0043bc6..72e9bb2 100644e
@@ -257,15 +257,9 @@ static void setup_display(void)
 
 int board_eth_init(bd_t *bis)
 {
-	int ret;
-
 	setup_iomux_enet();
 
-	ret = cpu_eth_init(bis);
-	if (ret)
-		printf("FEC MXC: %s:failed\n", __func__);
-
-	return ret;
+	return cpu_eth_init(bis);
 }
 
 int board_early_init_f(void)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH v2 2/6 titanium: Return from cpu_eth_init() directly

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

---
 board/barco/titanium/titanium.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
board/barco/titanium/titanium.c +1 -7
index 6db4488..84a7b84 100644
@@ -264,15 +264,9 @@ int board_phy_config(struct phy_device *phydev)
 
 int board_eth_init(bd_t *bis)
 {
-	int ret;
-
 	setup_iomux_enet();
 
-	ret = cpu_eth_init(bis);
-	if (ret)
-		printf("FEC MXC: %s:failed\n", __func__);
-
-	return ret;
+	return cpu_eth_init(bis);
 }
 
 int board_early_init_f(void)
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH v2 2/6 titanium: Return from cpu_eth_init() directly

Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

Thanks,
Stefan

#3 lore raw

PATCH v2 3/6 mx6qarm2: Remove unneeded error message when cpu_eth_init() fails

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

---
Changes since v1:
- Separate declarations and code by a blank line

 board/freescale/mx6qarm2/mx6qarm2.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
board/freescale/mx6qarm2/mx6qarm2.c +2 -5
index e063407..6c51f3a 100644
@@ -186,13 +186,10 @@ int fecmxc_mii_postcall(int phy)
 int board_eth_init(bd_t *bis)
 {
 	struct eth_device *dev;
-	int ret;
+	int ret = cpu_eth_init(bis);
 
-	ret = cpu_eth_init(bis);
-	if (ret) {
-		printf("FEC MXC: %s:failed\n", __func__);
+	if (ret)
 		return ret;
-	}
 
 	dev = eth_get_dev_by_name("FEC");
 	if (!dev) {
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH v2 4/6 mx6qsabreauto: Return from cpu_eth_init() directly

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

---
 board/freescale/mx6qsabreauto/mx6qsabreauto.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
board/freescale/mx6qsabreauto/mx6qsabreauto.c +1 -7
index fc75eae..928dadf 100644
@@ -192,15 +192,9 @@ int board_phy_config(struct phy_device *phydev)
 
 int board_eth_init(bd_t *bis)
 {
-	int ret;
-
 	setup_iomux_enet();
 
-	ret = cpu_eth_init(bis);
-	if (ret)
-		printf("FEC MXC: %s:failed\n", __func__);
-
-	return ret;
+	return cpu_eth_init(bis);
 }
 
 #define BOARD_REV_B  0x200
Signature · 1 line
1.8.1.2
#5 lore raw

PATCH v2 5/6 mx6sabresd: Return from cpu_eth_init() directly

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

---
 board/freescale/mx6sabresd/mx6sabresd.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
board/freescale/mx6sabresd/mx6sabresd.c +1 -7
index 2ffc3b8..12d8c56 100644
@@ -453,15 +453,9 @@ int overwrite_console(void)
 
 int board_eth_init(bd_t *bis)
 {
-	int ret;
-
 	setup_iomux_enet();
 
-	ret = cpu_eth_init(bis);
-	if (ret)
-		printf("FEC MXC: %s:failed\n", __func__);
-
-	return ret;
+	return cpu_eth_init(bis);
 }
 
 int board_early_init_f(void)
Signature · 1 line
1.8.1.2
#6 lore raw

PATCH v2 6/6 mx6slevk: Return from cpu_eth_init() directly

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

---
 board/freescale/mx6slevk/mx6slevk.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
board/freescale/mx6slevk/mx6slevk.c +1 -9
index 47c04ce..c496254 100644
@@ -106,17 +106,9 @@ int board_mmc_init(bd_t *bis)
 #ifdef CONFIG_FEC_MXC
 int board_eth_init(bd_t *bis)
 {
-	int ret;
-
 	setup_iomux_fec();
 
-	ret = cpu_eth_init(bis);
-	if (ret) {
-		printf("FEC MXC: %s:failed\n", __func__);
-		return ret;
-	}
-
-	return 0;
+	return cpu_eth_init(bis);
 }
 
 static int setup_fec(void)
Signature · 1 line
1.8.1.2
#7 lore raw

PATCH v2 1/6 wandboard: Return from cpu_eth_init() directly

In reply to Fabio Estevam
Quoted 10 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

There is no need to print an error message when cpu_eth_init() fails because net/eth.c already prints it.

In order to simplify the code, just return the value from cpu_eth_init(bis) directly.

---

Applied (whole series) to u-boot-imx, 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
=====================================================================