@@ -655,8 +655,6 @@ PCIDevice *pci_create_simple_multifunction(PCIBus *bus, int devfn,
const char *name);
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name);
-void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev);
-
qemu_irq pci_allocate_irq(PCIDevice *pci_dev);
void pci_set_irq(PCIDevice *pci_dev, int level);
@@ -294,8 +294,7 @@ static void realview_init(MachineState *machine,
}
n = drive_get_max_bus(IF_SCSI);
while (n >= 0) {
- dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
- lsi53c8xx_handle_legacy_cmdline(dev);
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
n--;
}
}
@@ -271,8 +271,7 @@ static void versatile_init(MachineState *machine, int board_id)
}
n = drive_get_max_bus(IF_SCSI);
while (n >= 0) {
- dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
- lsi53c8xx_handle_legacy_cmdline(dev);
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
n--;
}
@@ -349,8 +349,7 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
/* SCSI disk setup. */
if (drive_get_max_bus(IF_SCSI) >= 0) {
- dev = DEVICE(pci_create_simple(pci_bus, -1, "lsi53c895a"));
- lsi53c8xx_handle_legacy_cmdline(dev);
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
}
/* Graphics setup. */
@@ -328,7 +328,6 @@ static void ibm_40p_init(MachineState *machine)
dev = DEVICE(pci_create_simple(pci_bus, PCI_DEVFN(1, 0),
"lsi53c810"));
- lsi53c8xx_handle_legacy_cmdline(dev);
qdev_connect_gpio_out(dev, 0, qdev_get_gpio_in(i82378_dev, 13));
/* XXX: s3-trio at PCI_DEVFN(2, 0) */
@@ -2365,6 +2365,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
QTAILQ_INIT(&s->queue);
scsi_bus_init(&s->bus, sizeof(s->bus), d, &lsi_scsi_info);
+ scsi_bus_legacy_handle_cmdline(&s->bus);
}
static void lsi_scsi_exit(PCIDevice *dev)
@@ -2422,10 +2423,3 @@ static void lsi53c895a_register_types(void)
}
type_init(lsi53c895a_register_types)
-
-void lsi53c8xx_handle_legacy_cmdline(DeviceState *lsi_dev)
-{
- LSIState *s = LSI53C895A(lsi_dev);
-
- scsi_bus_legacy_handle_cmdline(&s->bus);
-}
Call scsi_bus_legacy_handle_cmdline() once in the DeviceRealize handler, just after scsi_bus_init(). No need for lsi53c8xx_handle_legacy_cmdline(), remove it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/hw/pci/pci.h | 2 -- hw/arm/realview.c | 3 +-- hw/arm/versatilepb.c | 3 +-- hw/hppa/machine.c | 3 +-- hw/ppc/prep.c | 1 - hw/scsi/lsi53c895a.c | 8 +------- 6 files changed, 4 insertions(+), 16 deletions(-)