Patchwork [U-Boot,v2,44/67] net: uli526x: Pull out init of struct eth_ops

login
register
mail settings
Submitter Tomas Hlavacek
Date Nov. 21, 2012, 1:23 p.m.
Message ID <1353504238-11277-45-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200732/
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Comments

Tomas Hlavacek - Nov. 21, 2012, 1:23 p.m.
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/uli526x.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/net/uli526x.c b/drivers/net/uli526x.c
index 33d8b49..65670db 100644
--- a/drivers/net/uli526x.c
+++ b/drivers/net/uli526x.c
@@ -198,6 +198,13 @@  static struct pci_device_id uli526x_pci_tbl[] = {
 	{}
 };
 
+static struct eth_ops uli526x_ops = {
+	.init = uli526x_init_one,
+	.halt = uli526x_disable,
+	.send = uli526x_start_xmit,
+	.recv = uli526x_rx_packet
+};
+
 /* ULI526X network board routine */
 
 /*
@@ -237,10 +244,7 @@  int uli526x_initialize(bd_t *bis)
 		db->pdev = devno;
 		dev->iobase = iobase;
 
-		dev->eo->init = uli526x_init_one;
-		dev->eo->halt = uli526x_disable;
-		dev->eo->send = uli526x_start_xmit;
-		dev->eo->recv = uli526x_rx_packet;
+		dev->eo = &uli526x_ops;
 
 		/* init db */
 		db->ioaddr = dev->iobase;