From patchwork Wed Nov 21 13:23:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,66/67] net: usb: asix: Pull out init of struct eth_ops From: Tomas Hlavacek X-Patchwork-Id: 200741 Message-Id: <1353504238-11277-67-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Wed, 21 Nov 2012 14:23:57 +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/usb/eth/asix.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c index f2cea6b..ed8bcdd 100644 --- a/drivers/usb/eth/asix.c +++ b/drivers/usb/eth/asix.c @@ -692,6 +692,13 @@ int asix_eth_probe(struct usb_device *dev, unsigned int ifnum, return 1; } +static struct eth_ops asix_ops = { + .init = asix_init, + .halt = asix_halt, + .send = asix_send, + .recv = asix_recv +}; + int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, struct eth_device *eth) { @@ -702,10 +709,7 @@ int asix_eth_get_info(struct usb_device *dev, struct ueth_data *ss, return 0; } sprintf(eth->name, "%s%d", ASIX_BASE_NAME, curr_eth_dev++); - eth->eo->init = asix_init; - eth->eo->send = asix_send; - eth->eo->recv = asix_recv; - eth->eo->halt = asix_halt; + eth->eo = &asix_ops; if (!(priv->flags & FLAG_TYPE_AX88172)) eth->eo->write_hwaddr = asix_write_hwaddr; eth->priv = ss;