Patchwork [U-Boot,v2,65/67] net: qe: uec: 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-66-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/200743/
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/qe/uec.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c
index 0aded61..09e267a 100644
--- a/drivers/qe/uec.c
+++ b/drivers/qe/uec.c
@@ -1361,6 +1361,13 @@  static int uec_recv(struct eth_device* dev)
 	return 1;
 }
 
+static struct eth_ops uec_ops = {
+	.init = uec_init,
+	.halt = uec_halt,
+	.send = uec_send,
+	.recv = uec_recv
+};
+
 int uec_initialize(bd_t *bis, uec_info_t *uec_info)
 {
 	struct eth_device	*dev;
@@ -1394,10 +1401,7 @@  int uec_initialize(bd_t *bis, uec_info_t *uec_info)
 	sprintf(dev->name, "UEC%d", uec_info->uf_info.ucc_num);
 	dev->iobase = 0;
 	dev->priv = (void *)uec;
-	dev->eo->init = uec_init;
-	dev->eo->halt = uec_halt;
-	dev->eo->send = uec_send;
-	dev->eo->recv = uec_recv;
+	dev->eo = &uec_ops;
 
 	/* Clear the ethnet address */
 	for (i = 0; i < 6; i++)