diff mbox

[U-Boot,v2,06/67] net: at91_emac: Pull out init of struct eth_ops

Message ID 1353504238-11277-7-git-send-email-tmshlvck@gmail.com
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Commit Message

Tomas Hlavacek Nov. 21, 2012, 1:22 p.m. UTC
Add static struct eth_ops and set ops function pointers statically.
Remove setting eth_ops members dynamically.

This is a step toward converting the driver for DM.

Signed-off-by: Tomas Hlavacek <tmshlvck@gmail.com>
---
 drivers/net/at91_emac.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c
index 3395dcc..464d539 100644
--- a/drivers/net/at91_emac.c
+++ b/drivers/net/at91_emac.c
@@ -494,6 +494,14 @@  static int at91emac_write_hwaddr(struct eth_device *netdev)
 	return 0;
 }
 
+static struct eth_ops at91emac_ops = {
+	.init = at91emac_init,
+	.halt = at91emac_halt,
+	.send = at91emac_send,
+	.recv = at91emac_recv,
+	.write_hwaddr = at91emac_write_hwaddr
+};
+
 int at91emac_register(bd_t *bis, unsigned long iobase)
 {
 	emac_device *emac;
@@ -518,11 +526,7 @@  int at91emac_register(bd_t *bis, unsigned long iobase)
 	sprintf(dev->name, "emac");
 	dev->iobase = iobase;
 	dev->priv = emacfix;
-	dev->eo->init = at91emac_init;
-	dev->eo->halt = at91emac_halt;
-	dev->eo->send = at91emac_send;
-	dev->eo->recv = at91emac_recv;
-	dev->eo->write_hwaddr = at91emac_write_hwaddr;
+	dev->eo = &at91emac_ops;
 
 	eth_register(dev);