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

login
register
mail settings
Submitter Tomas Hlavacek
Date Nov. 2, 2012, 5:18 p.m.
Message ID <1351876722-5183-18-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/196647/
State Superseded
Delegated to: Joe Hershberger
Headers show

Comments

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

Patch

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