Skip to content

Commit

Permalink
hw/isa/piix4: Move pci_ide_create_devs() call to board code
Browse files Browse the repository at this point in the history
For the VIA south bridges there was a comment to have the call in board code.
Move it there for PIIX4 as well for consistency.

Signed-off-by: Bernhard Beschow <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
  • Loading branch information
shentok authored and philmd committed Oct 31, 2022
1 parent a1c100d commit d240d3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion hw/isa/piix4.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ static void piix4_realize(PCIDevice *dev, Error **errp)
if (!qdev_realize(DEVICE(&s->ide), BUS(pci_bus), errp)) {
return;
}
pci_ide_create_devs(PCI_DEVICE(&s->ide));

/* USB */
qdev_prop_set_int32(DEVICE(&s->uhci), "addr", dev->devfn + 2);
Expand Down
10 changes: 6 additions & 4 deletions hw/mips/malta.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "hw/pci/pci.h"
#include "qemu/log.h"
#include "hw/mips/bios.h"
#include "hw/ide.h"
#include "hw/ide/pci.h"
#include "hw/irq.h"
#include "hw/loader.h"
#include "elf.h"
Expand Down Expand Up @@ -1427,11 +1427,13 @@ void mips_malta_init(MachineState *machine)
/* Southbridge */
piix4 = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(10, 0), true,
TYPE_PIIX4_PCI_DEVICE);
dev = DEVICE(piix4);
isa_bus = ISA_BUS(qdev_get_child_bus(dev, "isa.0"));
isa_bus = ISA_BUS(qdev_get_child_bus(DEVICE(piix4), "isa.0"));

dev = DEVICE(object_resolve_path_component(OBJECT(piix4), "ide"));
pci_ide_create_devs(PCI_DEVICE(dev));

/* Interrupt controller */
qdev_connect_gpio_out_named(dev, "intr", 0, i8259_irq);
qdev_connect_gpio_out_named(DEVICE(piix4), "intr", 0, i8259_irq);

/* generate SPD EEPROM data */
dev = DEVICE(object_resolve_path_component(OBJECT(piix4), "pm"));
Expand Down

0 comments on commit d240d3f

Please sign in to comment.