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

login
register
mail settings
Submitter Tomas Hlavacek
Date Nov. 21, 2012, 1:23 p.m.
Message ID <1353504238-11277-40-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200711/
State Changes Requested
Delegated to: Joe Hershberger
Headers show

Comments

Tomas Hlavacek - Nov. 21, 2012, 1:23 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/rtl8169.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

Patch

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