[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 34/39] mc146818rtc: always register rtc to rtc list
From: |
Paolo Bonzini |
Subject: |
[PULL 34/39] mc146818rtc: always register rtc to rtc list |
Date: |
Thu, 24 Oct 2019 16:03:50 +0200 |
From: Hervé Poussineau <address@hidden>
We are not required anymore to use rtc_init() function.
Acked-by: Michael S. Tsirkin <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Hervé Poussineau <address@hidden>
Message-Id: <address@hidden>
[PMD: rebased, fix OBJECT() value]
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/timer/mc146818rtc.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index dce4dae..0d7784b 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -964,17 +964,16 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)
object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL);
qdev_init_gpio_out(dev, &s->irq, 1);
+ QLIST_INSERT_HEAD(&rtc_devices, s, link);
}
ISADevice *mc146818_rtc_init(ISABus *bus, int base_year, qemu_irq
intercept_irq)
{
DeviceState *dev;
ISADevice *isadev;
- RTCState *s;
isadev = isa_create(bus, TYPE_MC146818_RTC);
dev = DEVICE(isadev);
- s = MC146818_RTC(isadev);
qdev_prop_set_int32(dev, "base_year", base_year);
qdev_init_nofail(dev);
if (intercept_irq) {
@@ -982,9 +981,8 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_year,
qemu_irq intercept_irq)
} else {
isa_connect_gpio_out(isadev, 0, RTC_ISA_IRQ);
}
- QLIST_INSERT_HEAD(&rtc_devices, s, link);
- object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(s),
+ object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(isadev),
"date", NULL);
return isadev;
@@ -1016,8 +1014,6 @@ static void rtc_class_initfn(ObjectClass *klass, void
*data)
dc->reset = rtc_resetdev;
dc->vmsd = &vmstate_rtc;
dc->props = mc146818rtc_properties;
- /* Reason: needs to be wired up by rtc_init() */
- dc->user_creatable = false;
}
static const TypeInfo mc146818rtc_info = {
--
1.8.3.1
- [PULL 29/39] hw/i386/pc: Extract pc_i8259_create(), (continued)
- [PULL 29/39] hw/i386/pc: Extract pc_i8259_create(), Paolo Bonzini, 2019/10/24
- [PULL 33/39] mc146818rtc: Include mc146818rtc_regs.h directly in mc146818rtc.c, Paolo Bonzini, 2019/10/24
- [PULL 13/39] hw/i386/pc: move shared x86 functions to x86.c and export them, Paolo Bonzini, 2019/10/24
- [PULL 27/39] hw/i386/pc: Extract pc_gsi_create(), Paolo Bonzini, 2019/10/24
- [PULL 31/39] mc146818rtc: move structure to header file, Paolo Bonzini, 2019/10/24
- [PULL 35/39] audio: fix missing break, Paolo Bonzini, 2019/10/24
- [PULL 38/39] target/i386: introduce cpu_set_fpus, Paolo Bonzini, 2019/10/24
- [PULL 37/39] target/i386: move FERR handling to target/i386, Paolo Bonzini, 2019/10/24
- [PULL 34/39] mc146818rtc: always register rtc to rtc list,
Paolo Bonzini <=
- [PULL 39/39] i386: implement IGNNE, Paolo Bonzini, 2019/10/24
- [PULL 36/39] core: replace getpagesize() with qemu_real_host_page_size, Paolo Bonzini, 2019/10/24
- Re: [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, no-reply, 2019/10/25
- Re: [PULL 00/39] Misc (mostly x86) patches for 2019-10-24, Peter Maydell, 2019/10/25