Skip to contentSkip to conversation

mx6slevk: Simplify the return value of setup_fec()

PATCH New Fabio Estevam 1 participant 2 messages Nov 17, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 mx6slevk: Simplify the return value of setup_fec()

From: Fabio Estevam <[email protected]>

We can simply the return the value from enable_fec_anatop_clock() to make the code smaller and simpler.

---
 board/freescale/mx6slevk/mx6slevk.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
board/freescale/mx6slevk/mx6slevk.c +1 -6
index e76c343..8111edf 100644
@@ -230,16 +230,11 @@ int board_eth_init(bd_t *bis)
 static int setup_fec(void)
 {
 	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
-	int ret;
 
 	/* clear gpr1[14], gpr1[18:17] to select anatop clock */
 	clrsetbits_le32(&iomuxc_regs->gpr[1], IOMUX_GPR1_FEC_MASK, 0);
 
-	ret = enable_fec_anatop_clock(ENET_50MHz);
-	if (ret)
-		return ret;
-
-	return 0;
+	return enable_fec_anatop_clock(ENET_50MHz);
 }
 #endif
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 mx6sxsabresd: Simplify the return value of setup_fec()

From: Fabio Estevam <[email protected]>

We can simply the return the value from enable_fec_anatop_clock() to make the code smaller and simpler.

---
 board/freescale/mx6sxsabresd/mx6sxsabresd.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
board/freescale/mx6sxsabresd/mx6sxsabresd.c +1 -6
index 68d3718..857a196 100644
@@ -119,7 +119,6 @@ static int setup_fec(void)
 {
 	struct iomuxc *iomuxc_regs = (struct iomuxc *)IOMUXC_BASE_ADDR;
 	struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
-	int ret;
 	int reg;
 
 	/* Use 125MHz anatop loopback REF_CLK1 for ENET1 */
@@ -140,11 +139,7 @@ static int setup_fec(void)
 	reg |= BM_ANADIG_PLL_ENET_REF_25M_ENABLE;
 	writel(reg, &anatop->pll_enet);
 
-	ret = enable_fec_anatop_clock(ENET_125MHz);
-	if (ret)
-		return ret;
-
-	return 0;
+	return enable_fec_anatop_clock(ENET_125MHz);
 }
 
 int board_eth_init(bd_t *bis)
Signature · 1 line
1.9.1