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

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:35 CET 2012


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 at gmail.com>
---
 drivers/net/uli526x.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

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;
-- 
1.7.2.5



More information about the U-Boot mailing list