summaryrefslogtreecommitdiffstats
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2013-02-08 10:18:44 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-02-11 09:34:29 +0100
commit2e2466f5ae7dd9f11a50a47aed5db76d2d8f8f68 (patch)
treeea76ef34aa21af784880af99e118e77fa6562192 /drivers/net/macb.c
parent5169b2d2c7e7fe45aa1addfa4c857759cd661db0 (diff)
downloadbarebox-2e2466f5ae7dd9f11a50a47aed5db76d2d8f8f68.tar.gz
barebox-2e2466f5ae7dd9f11a50a47aed5db76d2d8f8f68.tar.xz
net macb: call macb_init at probe explicitly
as eth_device init is planning for remove and we need the init before register the mdio bus Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 2eba2a52f1..3aec0c4aeb 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -241,9 +241,8 @@ static int macb_open(struct eth_device *edev)
macb->interface);
}
-static int macb_init(struct eth_device *edev)
+static void macb_init(struct macb_device *macb)
{
- struct macb_device *macb = edev->priv;
unsigned long paddr, val = 0;
int i;
@@ -284,8 +283,6 @@ static int macb_init(struct eth_device *edev)
/* Enable TX and RX */
macb_writel(macb, NCR, MACB_BIT(TE) | MACB_BIT(RE));
-
- return 0;
}
static void macb_halt(struct eth_device *edev)
@@ -423,7 +420,6 @@ static int macb_probe(struct device_d *dev)
macb->dev = dev;
- edev->init = macb_init;
edev->open = macb_open;
edev->send = macb_send;
edev->recv = macb_recv;
@@ -474,6 +470,8 @@ static int macb_probe(struct device_d *dev)
macb_writel(macb, NCFGR, ncfgr);
+ macb_init(macb);
+
mdiobus_register(&macb->miibus);
eth_register(edev);