From patchwork Wed Nov 21 13:23:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,65/67] net: qe: uec: Pull out init of struct eth_ops From: Tomas Hlavacek X-Patchwork-Id: 200743 Message-Id: <1353504238-11277-66-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Wed, 21 Nov 2012 14:23:56 +0100 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/qe/uec.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/qe/uec.c b/drivers/qe/uec.c index 0aded61..09e267a 100644 --- a/drivers/qe/uec.c +++ b/drivers/qe/uec.c @@ -1361,6 +1361,13 @@ static int uec_recv(struct eth_device* dev) return 1; } +static struct eth_ops uec_ops = { + .init = uec_init, + .halt = uec_halt, + .send = uec_send, + .recv = uec_recv +}; + int uec_initialize(bd_t *bis, uec_info_t *uec_info) { struct eth_device *dev; @@ -1394,10 +1401,7 @@ int uec_initialize(bd_t *bis, uec_info_t *uec_info) sprintf(dev->name, "UEC%d", uec_info->uf_info.ucc_num); dev->iobase = 0; dev->priv = (void *)uec; - dev->eo->init = uec_init; - dev->eo->halt = uec_halt; - dev->eo->send = uec_send; - dev->eo->recv = uec_recv; + dev->eo = &uec_ops; /* Clear the ethnet address */ for (i = 0; i < 6; i++)