ioapic: Cleanup for QOM'ification

Some cleanups:
* ioapic_common.c: Rename 'register_types' to 'ioapic_common_register_types'
* Replace inline 'DEVICE(s)' with local 'DeviceState *dev' variable

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
xiaoqiang zhao 2013-11-05 18:16:04 +08:00 committed by Andreas Färber
parent 494c271784
commit f97718584b
3 changed files with 8 additions and 4 deletions

View File

@ -129,9 +129,11 @@ static void kvm_ioapic_set_irq(void *opaque, int irq, int level)
static void kvm_ioapic_init(IOAPICCommonState *s, int instance_no)
{
DeviceState *dev = DEVICE(s);
memory_region_init_reservation(&s->io_memory, NULL, "kvm-ioapic", 0x1000);
qdev_init_gpio_in(DEVICE(s), kvm_ioapic_set_irq, IOAPIC_NUM_PINS);
qdev_init_gpio_in(dev, kvm_ioapic_set_irq, IOAPIC_NUM_PINS);
}
static Property kvm_ioapic_properties[] = {

View File

@ -227,10 +227,12 @@ static const MemoryRegionOps ioapic_io_ops = {
static void ioapic_init(IOAPICCommonState *s, int instance_no)
{
DeviceState *dev = DEVICE(s);
memory_region_init_io(&s->io_memory, OBJECT(s), &ioapic_io_ops, s,
"ioapic", 0x1000);
qdev_init_gpio_in(DEVICE(s), ioapic_set_irq, IOAPIC_NUM_PINS);
qdev_init_gpio_in(dev, ioapic_set_irq, IOAPIC_NUM_PINS);
ioapics[instance_no] = s;
}

View File

@ -109,9 +109,9 @@ static const TypeInfo ioapic_common_type = {
.abstract = true,
};
static void register_types(void)
static void ioapic_common_register_types(void)
{
type_register_static(&ioapic_common_type);
}
type_init(register_types)
type_init(ioapic_common_register_types)