From patchwork Fri Nov 2 17:18:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,42/50] net: smc911x: Pull out init of struct eth_ops Date: Fri, 02 Nov 2012 07:18:34 -0000 From: Tomas Hlavacek X-Patchwork-Id: 196662 Message-Id: <1351876722-5183-43-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/smc911x.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 5ba1bdf..0369376 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -251,6 +251,13 @@ static int smc911x_miiphy_write(const char *devname, u8 phy, u8 reg, u16 val) } #endif +static struct eth_ops smc911x_ops = { + .init = smc911x_init, + .halt = smc911x_halt, + .send = smc911x_send, + .recv = smc911x_rx +}; + int smc911x_initialize(u8 dev_num, int base_addr) { unsigned long addrl, addrh; @@ -282,10 +289,7 @@ int smc911x_initialize(u8 dev_num, int base_addr) dev->enetaddr[5] = addrh >> 8; } - dev->eo->init = smc911x_init; - dev->eo->halt = smc911x_halt; - dev->eo->send = smc911x_send; - dev->eo->recv = smc911x_rx; + dev->eo = &smc911x_ops; sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num); eth_register(dev);