From patchwork Wed Nov 21 13:23:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,26/67] net: lan91c96: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:17 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200737 Message-Id: <1353504238-11277-27-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de 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/lan91c96.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c index d87302b..4e4e2e4 100644 --- a/drivers/net/lan91c96.c +++ b/drivers/net/lan91c96.c @@ -785,6 +785,13 @@ static int lan91c96_detect_chip(struct eth_device *dev) return 0; } +static struct eth_ops lan91c96_ops = { + .init = lan91c96_init, + .halt = lan91c96_halt, + .send = lan91c96_send, + .recv = lan91c96_recv +}; + int lan91c96_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -806,10 +813,7 @@ int lan91c96_initialize(u8 dev_num, int base_addr) } get_rom_mac(dev, dev->enetaddr); - dev->eo->init = lan91c96_init; - dev->eo->halt = lan91c96_halt; - dev->eo->send = lan91c96_send; - dev->eo->recv = lan91c96_recv; + dev->eo = &lan91c96_ops; sprintf(dev->name, "%s-%hu", supported_chips[r].name, dev_num); eth_register(dev);