ipack.c (760df0d121a836dcbf3726b80b820115aef21b30) ipack.c (b69c3c21a5d11075d42100d5cfe0a736593fae6b)
1/*
2 * QEMU IndustryPack emulation
3 *
4 * Copyright (C) 2012 Igalia, S.L.
5 * Author: Alberto Garcia <berto@igalia.com>
6 *
7 * This code is licensed under the GNU GPL v2 or (at your option) any
8 * later version.

--- 46 unchanged lines hidden (view full) ---

55 }
56 bus->free_slot = idev->slot + 1;
57
58 idev->irq = qemu_allocate_irqs(bus->set_irq, idev, 2);
59
60 k->realize(dev, errp);
61}
62
1/*
2 * QEMU IndustryPack emulation
3 *
4 * Copyright (C) 2012 Igalia, S.L.
5 * Author: Alberto Garcia <berto@igalia.com>
6 *
7 * This code is licensed under the GNU GPL v2 or (at your option) any
8 * later version.

--- 46 unchanged lines hidden (view full) ---

55 }
56 bus->free_slot = idev->slot + 1;
57
58 idev->irq = qemu_allocate_irqs(bus->set_irq, idev, 2);
59
60 k->realize(dev, errp);
61}
62
63static void ipack_device_unrealize(DeviceState *dev, Error **errp)
63static void ipack_device_unrealize(DeviceState *dev)
64{
65 IPackDevice *idev = IPACK_DEVICE(dev);
66 IPackDeviceClass *k = IPACK_DEVICE_GET_CLASS(dev);
64{
65 IPackDevice *idev = IPACK_DEVICE(dev);
66 IPackDeviceClass *k = IPACK_DEVICE_GET_CLASS(dev);
67 Error *err = NULL;
68
69 if (k->unrealize) {
67
68 if (k->unrealize) {
70 k->unrealize(dev, &err);
71 error_propagate(errp, err);
69 k->unrealize(dev);
72 return;
73 }
74
75 qemu_free_irqs(idev->irq, 2);
76}
77
78static Property ipack_device_props[] = {
79 DEFINE_PROP_INT32("slot", IPackDevice, slot, -1),

--- 46 unchanged lines hidden ---
70 return;
71 }
72
73 qemu_free_irqs(idev->irq, 2);
74}
75
76static Property ipack_device_props[] = {
77 DEFINE_PROP_INT32("slot", IPackDevice, slot, -1),

--- 46 unchanged lines hidden ---