Patchwork [U-Boot,RFC,05/50] net: armada100_fec: Pull out init of struct eth_ops

login
register
mail settings
Submitter Tomas Hlavacek
Date Nov. 2, 2012, 5:17 p.m.
Message ID <1351876722-5183-6-git-send-email-tmshlvck@gmail.com>
Download mbox | patch
Permalink /patch/196630/
State Superseded
Delegated to: Joe Hershberger
Headers show

Comments

Tomas Hlavacek - Nov. 2, 2012, 5:17 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/armada100_fec.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Patch

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