aboutsummaryrefslogtreecommitdiff
path: root/hw/rtl8139.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-09-16 13:40:27 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:50 -0500
commit7f23f812c49da6d6fe03bcd4bc2d07341e93db11 (patch)
tree68577e6d08641474f5dd3ea919e343b68eb14fe1 /hw/rtl8139.c
parentac0be998009257f0368e25470bac4e85b694ceaf (diff)
qemu/qdev: type safety in reset handler
Add type safety to qdev reset handlers, by declaring them as DeviceState * rather than void *. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/rtl8139.c')
-rw-r--r--hw/rtl8139.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/rtl8139.c b/hw/rtl8139.c
index db9cb5afe0..10daeb2f1f 100644
--- a/hw/rtl8139.c
+++ b/hw/rtl8139.c
@@ -1173,9 +1173,9 @@ static void rtl8139_reset_rxring(RTL8139State *s, uint32_t bufferSize)
s->RxBufAddr = 0;
}
-static void rtl8139_reset(void *opaque)
+static void rtl8139_reset(DeviceState *d)
{
- RTL8139State *s = opaque;
+ RTL8139State *s = container_of(d, RTL8139State, dev.qdev);
int i;
/* restore MAC address */
@@ -1371,7 +1371,7 @@ static void rtl8139_ChipCmd_write(RTL8139State *s, uint32_t val)
if (val & CmdReset)
{
DEBUG_PRINT(("RTL8139: ChipCmd reset\n"));
- rtl8139_reset(s);
+ rtl8139_reset(&s->dev.qdev);
}
if (val & CmdRxEnb)
{
@@ -1544,7 +1544,7 @@ static void rtl8139_Cfg9346_write(RTL8139State *s, uint32_t val)
} else if (opmode == 0x40) {
/* Reset. */
val = 0;
- rtl8139_reset(s);
+ rtl8139_reset(&s->dev.qdev);
}
s->Cfg9346 = val;
@@ -3464,7 +3464,7 @@ static int pci_rtl8139_init(PCIDevice *dev)
PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map);
qdev_get_macaddr(&dev->qdev, s->macaddr);
- rtl8139_reset(s);
+ rtl8139_reset(&s->dev.qdev);
s->vc = qdev_get_vlan_client(&dev->qdev,
rtl8139_can_receive, rtl8139_receive, NULL,
rtl8139_cleanup, s);