[PATCH 1/7] macb: call macb_init at probe explecitly
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Fri Feb 8 04:18:44 EST 2013
as eth_device init is planning for remove and we need the init before register
the mdio bus
Cc: Nicolas Ferre <nicolas.ferre at atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
drivers/net/macb.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 2eba2a5..3aec0c4 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);
--
1.7.10.4
More information about the barebox
mailing list