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

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:03 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/dc2114x.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 0361699..afdc088 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -207,6 +207,13 @@ static struct pci_device_id supported[] = {
 	{ }
 };
 
+static struct eth_ops dc21x4x_ops = {
+	.init = dc21x4x_init,
+	.halt = dc21x4x_halt,
+	.send = dc21x4x_send,
+	.recv = dc21x4x_recv
+};
+
 int dc21x4x_initialize(bd_t *bis)
 {
 	int			idx=0;
@@ -299,11 +306,8 @@ int dc21x4x_initialize(bd_t *bis)
 #else
 		dev->iobase = pci_mem_to_phys(devbusfn, iobase);
 #endif
-		dev->priv   = (void*) devbusfn;
-		dev->eo->init   = dc21x4x_init;
-		dev->eo->halt   = dc21x4x_halt;
-		dev->eo->send   = dc21x4x_send;
-		dev->eo->recv   = dc21x4x_recv;
+		dev->priv = (void *) devbusfn;
+		dev->eo = &dc21x4x_ops;
 
 		/* Ensure we're not sleeping. */
 		pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);
-- 
1.7.2.5



More information about the U-Boot mailing list