From patchwork Fri Nov 2 17:18:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,RFC,32/50] net: mpc512x_fec: Pull out init of struct eth_ops Date: Fri, 02 Nov 2012 07:18:24 -0000 From: Tomas Hlavacek X-Patchwork-Id: 196673 Message-Id: <1351876722-5183-33-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/mpc512x_fec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index 4aa3b28..d10a70a 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -608,6 +608,13 @@ static int mpc512x_fec_recv (struct eth_device *dev) return frame_length; } +static struct eth_ops mpc512x_fec_ops = { + .init = mpc512x_fec_init, + .halt = mpc512x_fec_halt, + .send = mpc512x_fec_send, + .recv = mpc512x_fec_recv +}; + /********************************************************************/ int mpc512x_fec_initialize (bd_t * bis) { @@ -629,10 +636,7 @@ int mpc512x_fec_initialize (bd_t * bis) # endif dev->priv = (void *)fec; dev->iobase = (int)&im->fec; - dev->eo->init = mpc512x_fec_init; - dev->eo->halt = mpc512x_fec_halt; - dev->eo->send = mpc512x_fec_send; - dev->eo->recv = mpc512x_fec_recv; + dev->eo = &mpc512x_fec_ops; sprintf (dev->name, "FEC"); eth_register (dev);