Skip to content

Commit

Permalink
xilinx_axienet: Register reset properly
Browse files Browse the repository at this point in the history
Register the reset function and the Device::reset function rather than
explicitly call it from the sysbus::init.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
  • Loading branch information
pete128 authored and edgarigl committed Apr 16, 2013
1 parent f0e7a81 commit 9ee0ceb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hw/net/xilinx_axienet.c
Expand Up @@ -402,8 +402,10 @@ static inline int axienet_newfunc_enabled(XilinxAXIEnet *s)
return !!(s->regs[R_RAF] & RAF_NEWFUNC_EN);
}

static void axienet_reset(XilinxAXIEnet *s)
static void xilinx_axienet_reset(DeviceState *d)
{
XilinxAXIEnet *s = XILINX_AXI_ENET(d);

axienet_rx_reset(s);
axienet_tx_reset(s);

Expand Down Expand Up @@ -871,7 +873,6 @@ static int xilinx_enet_init(SysBusDevice *dev)
s->TEMAC.parent = s;

s->rxmem = g_malloc(s->c_rxmem);
axienet_reset(s);

return 0;
}
Expand Down Expand Up @@ -902,6 +903,7 @@ static void xilinx_enet_class_init(ObjectClass *klass, void *data)

k->init = xilinx_enet_init;
dc->props = xilinx_enet_properties;
dc->reset = xilinx_axienet_reset;
ssc->push = axienet_stream_push;
}

Expand Down

0 comments on commit 9ee0ceb

Please sign in to comment.