summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Shen <voice.shen@atmel.com>2013-08-19 10:35:47 +0800
committerAndreas Bießmann <andreas.devel@googlemail.com>2013-08-22 16:49:29 +0200
commit8314ccd8d4fe36abab034260ee66cd8c2b6de39b (patch)
tree262e3509a528e4d0f5f21e05cc95d4c824c3d6ed
parent9ed887caecb9ecb0c68773a1870d143b9f28d3da (diff)
downloadu-boot-imx-8314ccd8d4fe36abab034260ee66cd8c2b6de39b.zip
u-boot-imx-8314ccd8d4fe36abab034260ee66cd8c2b6de39b.tar.gz
u-boot-imx-8314ccd8d4fe36abab034260ee66cd8c2b6de39b.tar.bz2
net: macb: fix the following building warning
fix the following building warning ---8>--- macb.c: In function 'macb_init': macb.c:400:14: warning: 'phydev' may be used uninitialized in this function macb.c:377:21: note: 'phydev' was declared here ---<8--- Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
-rw-r--r--drivers/net/macb.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1f7cc32..bf3983a 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -36,6 +36,7 @@
#include <asm/io.h>
#include <asm/dma-mapping.h>
#include <asm/arch/clk.h>
+#include <asm-generic/errno.h>
#include "macb.h"
@@ -397,9 +398,14 @@ static int macb_phy_init(struct macb_device *macb)
}
#ifdef CONFIG_PHYLIB
- phydev->bus = macb->bus;
- phydev->dev = netdev;
- phydev->addr = macb->phy_addr;
+ /* need to consider other phy interface mode */
+ phydev = phy_connect(macb->bus, macb->phy_addr, netdev,
+ PHY_INTERFACE_MODE_RGMII);
+ if (!phydev) {
+ printf("phy_connect failed\n");
+ return -ENODEV;
+ }
+
phy_config(phydev);
#endif