Patchwork [v3,09/16] isa: remove unused parameter to isa_bus_bridge_init()

login
register
mail settings
Submitter Hervé Poussineau
Date Oct. 2, 2011, 4:10 p.m.
Message ID <1317571828-9059-10-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/117339/
State New
Headers show

Comments

Hervé Poussineau - Oct. 2, 2011, 4:10 p.m.
Remove code which is now dead

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/isa-bus.c   |   60 +++++++------------------------------------------------
 hw/isa.h       |    2 +-
 hw/mips_jazz.c |    2 +-
 hw/mips_r4k.c  |    2 +-
 hw/pc_piix.c   |    2 +-
 hw/ppc_prep.c  |    2 +-
 6 files changed, 13 insertions(+), 57 deletions(-)

Patch

diff --git a/hw/isa-bus.c b/hw/isa-bus.c
index dd539e5..e783a7f 100644
--- a/hw/isa-bus.c
+++ b/hw/isa-bus.c
@@ -24,8 +24,6 @@ 
 
 static ISABus *isabus;
 target_phys_addr_t isa_mem_base = 0;
-static qemu_irq *isa_bus_default_irqs;
-static MemoryRegion *isa_bus_io_space;
 
 static void isabus_dev_print(Monitor *mon, DeviceState *dev, int indent);
 static char *isabus_get_fw_dev_path(DeviceState *dev);
@@ -37,59 +35,17 @@  static struct BusInfo isa_bus_info = {
     .get_fw_dev_path = isabus_get_fw_dev_path,
 };
 
-static void isa_bus_default_set_irqs(ISABus *bus, qemu_irq *irqs)
+ISABus *isa_bus_bridge_init(MemoryRegion *address_space_io)
 {
-    isa_bus_default_irqs = irqs;
-}
-
-static qemu_irq isa_bus_default_get_irq(ISABus *bus, int isairq)
-{
-    if (isairq < 0 || isairq > 15) {
-        hw_error("isa irq %d invalid", isairq);
-    }
-    return isa_bus_default_irqs[isairq];
-}
-
-static void isa_bus_default_set_io_space(ISABus *bus, MemoryRegion *io_space)
-{
-    isa_bus_io_space = io_space;
-}
-
-static MemoryRegion *isa_bus_default_get_io_space(ISABus *bus)
-{
-    return isa_bus_io_space;
-}
-
-static MemoryRegion *isa_bus_default_get_memory_space(ISABus *bus)
-{
-    return get_system_memory();
-}
-
-static ISABusOps isa_bus_default_ops = {
-    .set_irqs = isa_bus_default_set_irqs,
-    .get_irq = isa_bus_default_get_irq,
-    .set_io_space = isa_bus_default_set_io_space,
-    .get_io_space = isa_bus_default_get_io_space,
-    .get_memory_space = isa_bus_default_get_memory_space,
-};
-
-ISABus *isa_bus_bridge_init(DeviceState *dev, MemoryRegion *address_space_io)
-{
-    if (isabus) {
-        fprintf(stderr, "Can't create a second ISA bus\n");
-        return NULL;
-    }
-    if (NULL == dev) {
-        dev = qdev_create(NULL, "isabus-bridge");
-        qdev_init_nofail(dev);
-    } else {
-        isabus = FROM_QBUS(ISABus, qbus_create(&isa_bus_info, dev, NULL));
-        isabus->ops = &isa_bus_default_ops;
-    }
+    DeviceState *dev;
+    ISABus *bus;
 
-    isabus->ops->set_io_space(isabus, address_space_io);
+    dev = qdev_create(NULL, "isabus-bridge");
+    qdev_init_nofail(dev);
+    bus = FROM_QBUS(ISABus, QLIST_FIRST(&dev->child_bus));
+    bus->ops->set_io_space(bus, address_space_io);
 
-    return isabus;
+    return bus;
 }
 
 void isa_bus_new(ISABus *bus, ISABusOps *ops, DeviceState *host)
diff --git a/hw/isa.h b/hw/isa.h
index 8d439b5..551f3c4 100644
--- a/hw/isa.h
+++ b/hw/isa.h
@@ -42,7 +42,7 @@  struct ISABusOps {
     MemoryRegion *(*get_memory_space)(ISABus *bus);
 };
 
-ISABus *isa_bus_bridge_init(DeviceState *dev, MemoryRegion *address_space_io);
+ISABus *isa_bus_bridge_init(MemoryRegion *address_space_io);
 
 void isa_bus_new(ISABus *bus, ISABusOps *ops, DeviceState *host);
 void isa_bus_irqs(qemu_irq *irqs);
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index d06eacd..3be9136 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -183,7 +183,7 @@  static void mips_jazz_init(MemoryRegion *address_space,
     memory_region_add_subregion(address_space, 0x8000d000, dma_dummy);
 
     /* ISA devices */
-    isa_bus = isa_bus_bridge_init(NULL, address_space_io);
+    isa_bus = isa_bus_bridge_init(address_space_io);
     i8259 = i8259_init(env->irq[4]);
     isa_bus_irqs(i8259);
     cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1);
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index 6562fb3..3fdde27 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -256,7 +256,7 @@  void mips_r4k_init (ram_addr_t ram_size,
     cpu_mips_clock_init(env);
 
     /* The PIC is attached to the MIPS CPU INT0 pin */
-    isa_bus_bridge_init(NULL, get_system_io());
+    isa_bus_bridge_init(get_system_io());
     i8259 = i8259_init(env->irq[2]);
     isa_bus_irqs(i8259);
 
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 7ccbfca..85b4d34 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -147,7 +147,7 @@  static void pc_init1(MemoryRegion *system_memory,
     } else {
         pci_bus = NULL;
         i440fx_state = NULL;
-        isa_bus = isa_bus_bridge_init(NULL, system_io);
+        isa_bus = isa_bus_bridge_init(system_io);
         no_hpet = 1;
     }
     isa_bus_irqs(isa_irq);
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 808c83e..d1e73d1 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -649,7 +649,7 @@  static void ppc_prep_init (ram_addr_t ram_size,
         hw_error("Only 6xx bus is supported on PREP machine\n");
     }
     /* Hmm, prep has no pci-isa bridge ??? */
-    isa_bus_bridge_init(NULL, get_system_io());
+    isa_bus_bridge_init(get_system_io());
     i8259 = i8259_init(first_cpu->irq_inputs[PPC6xx_INPUT_INT]);
     pci_bus = pci_prep_init(i8259, get_system_memory(), get_system_io());
     isa_bus_irqs(i8259);