Revision dc4b9240

b/hw/intel-hda.c
61 61
    return info->init(dev);
62 62
}
63 63

  
64
static int hda_codec_dev_exit(DeviceState *qdev)
65
{
66
    HDACodecDevice *dev = DO_UPCAST(HDACodecDevice, qdev, qdev);
67

  
68
    if (dev->info->exit) {
69
        dev->info->exit(dev);
70
    }
71
    return 0;
72
}
73

  
64 74
void hda_codec_register(HDACodecDeviceInfo *info)
65 75
{
66 76
    info->qdev.init = hda_codec_dev_init;
77
    info->qdev.exit = hda_codec_dev_exit;
67 78
    info->qdev.bus_info = &hda_codec_bus_info;
68 79
    qdev_register(&info->qdev);
69 80
}
......
1137 1148
    return 0;
1138 1149
}
1139 1150

  
1151
static int intel_hda_exit(PCIDevice *pci)
1152
{
1153
    IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci);
1154

  
1155
    cpu_unregister_io_memory(d->mmio_addr);
1156
    return 0;
1157
}
1158

  
1140 1159
static int intel_hda_post_load(void *opaque, int version)
1141 1160
{
1142 1161
    IntelHDAState* d = opaque;
......
1219 1238
    .qdev.vmsd    = &vmstate_intel_hda,
1220 1239
    .qdev.reset   = intel_hda_reset,
1221 1240
    .init         = intel_hda_init,
1241
    .exit         = intel_hda_exit,
1222 1242
    .qdev.props   = (Property[]) {
1223 1243
        DEFINE_PROP_UINT32("debug", IntelHDAState, debug, 0),
1224 1244
        DEFINE_PROP_END_OF_LIST(),
b/hw/intel-hda.h
32 32
struct HDACodecDeviceInfo {
33 33
    DeviceInfo qdev;
34 34
    int (*init)(HDACodecDevice *dev);
35
    int (*exit)(HDACodecDevice *dev);
35 36
    void (*command)(HDACodecDevice *dev, uint32_t nid, uint32_t data);
36 37
    void (*stream)(HDACodecDevice *dev, uint32_t stnr, bool running);
37 38
};

Also available in: Unified diff