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

Tomas Hlavacek tmshlvck at gmail.com
Fri Nov 2 18:18:31 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/rtl8139.c |   18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c
index ed02cf6..15e9f5f 100644
--- a/drivers/net/rtl8139.c
+++ b/drivers/net/rtl8139.c
@@ -200,6 +200,16 @@ static struct pci_device_id supported[] = {
        {}
 };
 
+static struct eth_ops rtl8139_ops = {
+	init = rtl8139_probe,
+	halt = rtl_disable,
+	send = rtl_transmit,
+	recv = rtl_poll,
+#ifdef CONFIG_MCAST_TFTP
+	mcast = rtl_bcast_addr
+#endif
+};
+
 int rtl8139_initialize(bd_t *bis)
 {
 	pci_dev_t devno;
@@ -229,13 +239,7 @@ int rtl8139_initialize(bd_t *bis)
 
 		dev->priv = (void *) devno;
 		dev->iobase = (int)bus_to_phys(iobase);
-		dev->eo->init = rtl8139_probe;
-		dev->eo->halt = rtl_disable;
-		dev->eo->send = rtl_transmit;
-		dev->eo->recv = rtl_poll;
-#ifdef CONFIG_MCAST_TFTP
-		dev->eo->mcast = rtl_bcast_addr;
-#endif
+		dev->eo = &rtl8139_ops;
 
 		eth_register (dev);
 
-- 
1.7.10.4



More information about the U-Boot mailing list