From patchwork Wed Nov 21 13:23:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,64/67] net: ftmac100: Pull out init of struct eth_ops X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200757 X-Patchwork-Delegate: joe.hershberger@gmail.com Message-Id: <1353504238-11277-65-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Wed, 21 Nov 2012 14:23:55 +0100 From: Tomas Hlavacek List-Id: U-Boot discussion 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 --- drivers/net/ftmac100.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index 6fd2bde..c353b3d 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -236,6 +236,13 @@ static int ftmac100_send(struct eth_device *dev, void *packet, int length) return 0; } +static struct eth_ops ftmac100_ops = { + .init = ftmac100_init, + .halt = ftmac100_halt, + .send = ftmac100_send, + .recv = ftmac100_recv +}; + int ftmac100_initialize (bd_t *bd) { struct eth_device *dev; @@ -260,10 +267,7 @@ int ftmac100_initialize (bd_t *bd) sprintf (dev->name, "FTMAC100"); dev->iobase = CONFIG_FTMAC100_BASE; - dev->eo->init = ftmac100_init; - dev->eo->halt = ftmac100_halt; - dev->eo->send = ftmac100_send; - dev->eo->recv = ftmac100_recv; + dev->eo = &ftmac100_ops; dev->priv = priv; eth_register (dev);