From patchwork Fri Nov 2 17:18:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot, RFC, 24/50] net: fsl_mcdmafec: Pull out init of struct eth_ops X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196655 X-Patchwork-Delegate: joe.hershberger@gmail.com Message-Id: <1351876722-5183-25-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Fri, 2 Nov 2012 18:18:16 +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/fsl_mcdmafec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c index 2e70d22..6a18809 100644 --- a/drivers/net/fsl_mcdmafec.c +++ b/drivers/net/fsl_mcdmafec.c @@ -512,6 +512,13 @@ static void fec_halt(struct eth_device *dev) #endif } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int mcdmafec_initialize(bd_t * bis) { struct eth_device *dev; @@ -533,10 +540,7 @@ int mcdmafec_initialize(bd_t * bis) sprintf(dev->name, "FEC%d", fec_info[i].index); dev->priv = &fec_info[i]; - dev->eo->init = fec_init; - dev->eo->halt = fec_halt; - dev->eo->send = fec_send; - dev->eo->recv = fec_recv; + dev->eo = &fec_ops; /* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_DMA_USE_INTSRAM