[U-Boot] [RFC PATCH 05/50] net: armada100_fec: Pull out init of struct eth_ops
Tomas Hlavacek
tmshlvck at gmail.com
Fri Nov 2 18:17:57 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/armada100_fec.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/net/armada100_fec.c b/drivers/net/armada100_fec.c
index f256381..d826e11 100644
--- a/drivers/net/armada100_fec.c
+++ b/drivers/net/armada100_fec.c
@@ -678,6 +678,13 @@ static int armdfec_recv(struct eth_device *dev)
return 0;
}
+static struct eth_ops armada100_fec_ops = {
+ .init = armdfec_init,
+ .halt = armdfec_halt,
+ .send = armdfec_send,
+ .recv = armdfec_recv
+};
+
int armada100_fec_register(unsigned long base_addr)
{
struct armdfec_device *darmdfec;
@@ -718,10 +725,7 @@ int armada100_fec_register(unsigned long base_addr)
/* must be less than sizeof(dev->name) */
strcpy(dev->name, "armd-fec0");
- dev->eo->init = armdfec_init;
- dev->eo->halt = armdfec_halt;
- dev->eo->send = armdfec_send;
- dev->eo->recv = armdfec_recv;
+ dev->eo = &armada100_fec_ops;
eth_register(dev);
--
1.7.10.4
More information about the U-Boot
mailing list