diff mbox

[U-Boot,RFC,37/50] net: pcnet: Pull out init of struct eth_ops

Message ID 1351876722-5183-38-git-send-email-tmshlvck@gmail.com
State Superseded
Delegated to: Joe Hershberger
Headers show

Commit Message

Tomas Hlavacek Nov. 2, 2012, 5:18 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/pcnet.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/net/pcnet.c b/drivers/net/pcnet.c
index 35254c3..8bb8c67 100644
--- a/drivers/net/pcnet.c
+++ b/drivers/net/pcnet.c
@@ -154,6 +154,12 @@  static struct pci_device_id supported[] = {
 	{}
 };
 
+static struct eth_ops pcnet_ops = {
+	.init = pcnet_init,
+	.halt = pcnet_halt,
+	.send = pcnet_send,
+	.recv = pcnet_recv
+};
 
 int pcnet_initialize (bd_t * bis)
 {
@@ -216,12 +222,9 @@  int pcnet_initialize (bd_t * bis)
 		}
 
 		/*
-		 * Setup device structure and register the driver.
+		 * Setup device ops and register the driver.
 		 */
-		dev->eo->init = pcnet_init;
-		dev->eo->halt = pcnet_halt;
-		dev->eo->send = pcnet_send;
-		dev->eo->recv = pcnet_recv;
+		dev->eo = &pcnet_ops;
 
 		eth_register (dev);
 	}