[U-Boot] [RFC PATCH 17/50] net: eepro100: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Fri Nov 2 18:18:09 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/eepro100.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index e3aa720..91d7f0b 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -408,6 +408,13 @@ static struct pci_device_id supported[] = {
 	{}
 };
 
+static struct eth_ops eepro100_ops = {
+	.init = eepro100_init,
+	.halt = eepro100_halt,
+	.send = eepro100_send,
+	.recv = eepro100_recv
+};
+
 int eepro100_initialize (bd_t * bis)
 {
 	pci_dev_t devno;
@@ -458,10 +465,7 @@ int eepro100_initialize (bd_t * bis)
 		sprintf (dev->name, "i82559#%d", card_number);
 		dev->priv = (void *) devno; /* this have to come before bus_to_phys() */
 		dev->iobase = bus_to_phys (iobase);
-		dev->eo->init = eepro100_init;
-		dev->eo->halt = eepro100_halt;
-		dev->eo->send = eepro100_send;
-		dev->eo->recv = eepro100_recv;
+		dev->eo = &eepro100_ops;
 
 		eth_register (dev);
 
-- 
1.7.10.4



More information about the U-Boot mailing list