From patchwork Fri Nov 2 17:18:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,38/50] net: plb2800_eth: Pull out init of struct eth_ops From: Tomas Hlavacek X-Patchwork-Id: 196659 Message-Id: <1351876722-5183-39-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Fri, 2 Nov 2012 18:18:30 +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/net/plb2800_eth.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/plb2800_eth.c b/drivers/net/plb2800_eth.c index d3eb692..3b5861f 100644 --- a/drivers/net/plb2800_eth.c +++ b/drivers/net/plb2800_eth.c @@ -92,6 +92,12 @@ static unsigned char * plb2800_get_mac_addr(void); static int rx_new; static int mac_addr_set = 0; +static struct eth_ops plb2800_eth_ops = { + .init = plb2800_eth_init, + .halt = plb2800_eth_halt, + .send = plb2800_eth_send, + .recv = plb2800_eth_recv +}; int plb2800_eth_initialize(bd_t * bis) { @@ -110,10 +116,7 @@ int plb2800_eth_initialize(bd_t * bis) memset(dev, 0, sizeof(*dev)); sprintf(dev->name, "PLB2800 Switch"); - dev->eo->init = plb2800_eth_init; - dev->eo->halt = plb2800_eth_halt; - dev->eo->send = plb2800_eth_send; - dev->eo->recv = plb2800_eth_recv; + dev->eo = &plb2800_eth_ops; eth_register(dev);