Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
hw/i386/pc: No need for rtc_state to be an out-parameter
Now that the RTC is created as part of the southbridges it doesn't need
to be an out-parameter any longer.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20230519084734.220480-3-shentey@gmail.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
shentok authored and mstsirkin committed May 19, 2023
1 parent f0bc6bf commit 87af48a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions hw/i386/pc.c
Expand Up @@ -1265,7 +1265,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,

void pc_basic_device_init(struct PCMachineState *pcms,
ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
ISADevice *rtc_state,
bool create_fdctrl,
uint32_t hpet_irqs)
{
Expand Down Expand Up @@ -1320,14 +1320,14 @@ void pc_basic_device_init(struct PCMachineState *pcms,
}

if (rtc_irq) {
qdev_connect_gpio_out(DEVICE(*rtc_state), 0, rtc_irq);
qdev_connect_gpio_out(DEVICE(rtc_state), 0, rtc_irq);
} else {
uint32_t irq = object_property_get_uint(OBJECT(*rtc_state),
uint32_t irq = object_property_get_uint(OBJECT(rtc_state),
"irq",
&error_fatal);
isa_connect_gpio_out(*rtc_state, 0, irq);
isa_connect_gpio_out(rtc_state, 0, irq);
}
object_property_add_alias(OBJECT(pcms), "rtc-time", OBJECT(*rtc_state),
object_property_add_alias(OBJECT(pcms), "rtc-time", OBJECT(rtc_state),
"date");

#ifdef CONFIG_XEN_EMU
Expand All @@ -1341,7 +1341,7 @@ void pc_basic_device_init(struct PCMachineState *pcms,
}
#endif

qemu_register_boot_set(pc_boot_set, *rtc_state);
qemu_register_boot_set(pc_boot_set, rtc_state);

if (!xen_enabled() &&
(x86ms->pit == ON_OFF_AUTO_AUTO || x86ms->pit == ON_OFF_AUTO_ON)) {
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/pc_piix.c
Expand Up @@ -277,7 +277,7 @@ static void pc_init1(MachineState *machine,
}

/* init basic PC hardware */
pc_basic_device_init(pcms, isa_bus, x86ms->gsi, &rtc_state, true,
pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, true,
0x4);

pc_nic_init(pcmc, isa_bus, pci_bus);
Expand Down
2 changes: 1 addition & 1 deletion hw/i386/pc_q35.c
Expand Up @@ -292,7 +292,7 @@ static void pc_q35_init(MachineState *machine)
}

/* init basic PC hardware */
pc_basic_device_init(pcms, isa_bus, x86ms->gsi, &rtc_state, !mc->no_floppy,
pc_basic_device_init(pcms, isa_bus, x86ms->gsi, rtc_state, !mc->no_floppy,
0xff0104);

if (pcms->sata_enabled) {
Expand Down
2 changes: 1 addition & 1 deletion include/hw/i386/pc.h
Expand Up @@ -167,7 +167,7 @@ uint64_t pc_pci_hole64_start(void);
DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
void pc_basic_device_init(struct PCMachineState *pcms,
ISABus *isa_bus, qemu_irq *gsi,
ISADevice **rtc_state,
ISADevice *rtc_state,
bool create_fdctrl,
uint32_t hpet_irqs);
void pc_cmos_init(PCMachineState *pcms,
Expand Down

0 comments on commit 87af48a

Please sign in to comment.