[U-Boot] [PATCH v2 46/67] net: xilinx_emaclite: Pull out init of struct eth_ops
Tomas Hlavacek
tmshlvck at gmail.com
Wed Nov 21 14:23:37 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/xilinx_emaclite.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index c0fefa7..b5be0a3 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -345,6 +345,13 @@ static int emaclite_recv(struct eth_device *dev)
}
+static struct eth_ops emaclite_ops = {
+ init = emaclite_init,
+ halt = emaclite_halt,
+ send = emaclite_send,
+ recv = emaclite_recv
+};
+
int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
int txpp, int rxpp)
{
@@ -369,10 +376,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr,
sprintf(dev->name, "Xelite.%lx", base_addr);
dev->iobase = base_addr;
- dev->eo->init = emaclite_init;
- dev->eo->halt = emaclite_halt;
- dev->eo->send = emaclite_send;
- dev->eo->recv = emaclite_recv;
+ dev->eo = &emaclite_ops;
eth_register(dev);
--
1.7.2.5
More information about the U-Boot
mailing list