From patchwork Fri Nov 2 17:18:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,13/50] net: dc2114x: Pull out init of struct eth_ops From: Tomas Hlavacek X-Patchwork-Id: 196650 Message-Id: <1351876722-5183-14-git-send-email-tmshlvck@gmail.com> To: u-boot@lists.denx.de Cc: marex@denx.de Date: Fri, 2 Nov 2012 18:18:05 +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/dc2114x.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c index 0361699..afdc088 100644 --- a/drivers/net/dc2114x.c +++ b/drivers/net/dc2114x.c @@ -207,6 +207,13 @@ static struct pci_device_id supported[] = { { } }; +static struct eth_ops dc21x4x_ops = { + .init = dc21x4x_init, + .halt = dc21x4x_halt, + .send = dc21x4x_send, + .recv = dc21x4x_recv +}; + int dc21x4x_initialize(bd_t *bis) { int idx=0; @@ -299,11 +306,8 @@ int dc21x4x_initialize(bd_t *bis) #else dev->iobase = pci_mem_to_phys(devbusfn, iobase); #endif - dev->priv = (void*) devbusfn; - dev->eo->init = dc21x4x_init; - dev->eo->halt = dc21x4x_halt; - dev->eo->send = dc21x4x_send; - dev->eo->recv = dc21x4x_recv; + dev->priv = (void *) devbusfn; + dev->eo = &dc21x4x_ops; /* Ensure we're not sleeping. */ pci_write_config_byte(devbusfn, PCI_CFDA_PSM, WAKEUP);