[U-Boot] [PATCH v2 65/67] net: qe: uec: Pull out init of struct eth_ops

Tomas Hlavacek tmshlvck at gmail.com
Wed Nov 21 14:23:56 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/qe/uec.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

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++)
-- 
1.7.2.5



More information about the U-Boot mailing list