From patchwork Wed Nov 21 13:23:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,v2,62/67] net: cpsw: Pull out init of struct eth_ops Date: Wed, 21 Nov 2012 03:23:53 -0000 From: Tomas Hlavacek X-Patchwork-Id: 200756 Message-Id: <1353504238-11277-63-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/cpsw.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c index c120d4e..1e2ca40 100644 --- a/drivers/net/cpsw.c +++ b/drivers/net/cpsw.c @@ -931,6 +931,13 @@ static int cpsw_phy_init(struct eth_device *dev, struct cpsw_slave *slave) return 1; } +static struct eth_ops cpsw_ops = { + .init = cpsw_init, + .halt = cpsw_halt, + .send = cpsw_send, + .recv = cpsw_recv +}; + int cpsw_register(struct cpsw_platform_data *data) { struct cpsw_priv *priv; @@ -974,10 +981,7 @@ int cpsw_register(struct cpsw_platform_data *data) strcpy(dev->name, "cpsw"); dev->iobase = 0; - dev->eo->init = cpsw_init; - dev->eo->halt = cpsw_halt; - dev->eo->send = cpsw_send; - dev->eo->recv = cpsw_recv; + dev->eo = &cpsw_ops; dev->priv = priv; eth_register(dev);