diff mbox series

[3/3] hw/scsi/esp: Call scsi_bus_legacy_handle_cmdline() once

Message ID 20241122111939.11936-4-philmd@linaro.org (mailing list archive)
State New
Headers show
Series hw/scsi: Cleanup around scsi_bus_legacy_handle_cmdline() | expand

Commit Message

Philippe Mathieu-Daudé Nov. 22, 2024, 11:19 a.m. UTC
Call scsi_bus_legacy_handle_cmdline() once in the DeviceRealize
handler, just after scsi_bus_init().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/m68k/next-cube.c | 2 --
 hw/m68k/q800.c      | 2 --
 hw/mips/jazz.c      | 2 --
 hw/scsi/esp.c       | 1 +
 hw/sparc/sun4m.c    | 1 -
 5 files changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c
index 08886d432c..f0fdbef7ae 100644
--- a/hw/m68k/next-cube.c
+++ b/hw/m68k/next-cube.c
@@ -851,8 +851,6 @@  static void next_scsi_init(DeviceState *pcdev)
 
     next_pc->scsi_reset = qdev_get_gpio_in(dev, 0);
     next_pc->scsi_dma = qdev_get_gpio_in(dev, 1);
-
-    scsi_bus_legacy_handle_cmdline(&esp->bus);
 }
 
 static void next_escc_init(DeviceState *pcdev)
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 556604e1dc..816a662fd9 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -487,8 +487,6 @@  static void q800_machine_init(MachineState *machine)
     memory_region_add_subregion(&m->macio, ESP_PDMA - IO_BASE,
                                 sysbus_mmio_get_region(sysbus, 1));
 
-    scsi_bus_legacy_handle_cmdline(&esp->bus);
-
     /* Apple Sound Chip */
 
     object_initialize_child(OBJECT(machine), "asc", &m->asc, TYPE_ASC);
diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c
index 0e43c9f0ba..71badb0616 100644
--- a/hw/mips/jazz.c
+++ b/hw/mips/jazz.c
@@ -347,8 +347,6 @@  static void mips_jazz_init(MachineState *machine,
     sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(rc4030, 5));
     sysbus_mmio_map(sysbus, 0, 0x80002000);
 
-    scsi_bus_legacy_handle_cmdline(&esp->bus);
-
     /* Floppy */
     for (n = 0; n < MAX_FD; n++) {
         fds[n] = drive_get(IF_FLOPPY, 0, n);
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index ac841dc32e..a1d2f6f380 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -1542,6 +1542,7 @@  static void sysbus_esp_realize(DeviceState *dev, Error **errp)
     qdev_init_gpio_in(dev, sysbus_esp_gpio_demux, 2);
 
     scsi_bus_init(&s->bus, sizeof(s->bus), dev, &esp_scsi_info);
+    scsi_bus_legacy_handle_cmdline(&s->bus);
 }
 
 static void sysbus_esp_hard_reset(DeviceState *dev)
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index d52e6a7213..26e0af43bf 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -338,7 +338,6 @@  static void *sparc32_dma_init(hwaddr dma_base,
     sysbus_mmio_map(SYS_BUS_DEVICE(dma), 0, dma_base);
 
     sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base);
-    scsi_bus_legacy_handle_cmdline(&esp->esp.bus);
 
     sysbus_mmio_map(SYS_BUS_DEVICE(lance), 0, le_base);