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

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

diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c
index c75fd4f..80f8443 100644
--- a/drivers/net/rtl8169.c
+++ b/drivers/net/rtl8169.c
@@ -872,6 +872,14 @@ static int rtl_init(struct eth_device *dev, bd_t *bis)
 	return 1;
 }
 
+static struct eth_ops rtl_ops = {
+	.init = rtl_reset,
+	.halt = rtl_halt,
+	.send = rtl_send,
+	.recv = rtl_recv
+};
+
+
 int rtl8169_initialize(bd_t *bis)
 {
 	pci_dev_t devno;
@@ -902,10 +910,7 @@ int rtl8169_initialize(bd_t *bis)
 		dev->priv = (void *) devno;
 		dev->iobase = (int)pci_mem_to_phys(devno, iobase);
 
-		dev->eo->init = rtl_reset;
-		dev->eo->halt = rtl_halt;
-		dev->eo->send = rtl_send;
-		dev->eo->recv = rtl_recv;
+		dev->eo = &rtl_ops;
 
 		eth_register (dev);
 
-- 
1.7.2.5



More information about the U-Boot mailing list