Patchwork [4/8,MIPS] qdev: Use qdev floppy disk controller in Jazz emulation

login
register
mail settings
Submitter Hervé Poussineau
Date Sept. 8, 2010, 8:39 p.m.
Message ID <1283978392-6313-5-git-send-email-hpoussin@reactos.org>
Download mbox | patch
Permalink /patch/64210/
State New
Headers show

Comments

Hervé Poussineau - Sept. 8, 2010, 8:39 p.m.
Remove fdctrl_init_sysbus() function, which is not used anymore

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
---
 hw/fdc.c       |   24 ------------------------
 hw/fdc.h       |    2 --
 hw/mips_jazz.c |   10 +---------
 3 files changed, 1 insertions(+), 35 deletions(-)

Patch

diff --git a/hw/fdc.c b/hw/fdc.c
index c159dcb..57d7e06 100644
--- a/hw/fdc.c
+++ b/hw/fdc.c
@@ -1889,30 +1889,6 @@  FDCtrl *fdctrl_init_isa(DriveInfo **fds)
     return &(DO_UPCAST(FDCtrlISABus, busdev, dev)->state);
 }
 
-FDCtrl *fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
-                           target_phys_addr_t mmio_base, DriveInfo **fds)
-{
-    FDCtrl *fdctrl;
-    DeviceState *dev;
-    FDCtrlSysBus *sys;
-
-    dev = qdev_create(NULL, "sysbus-fdc");
-    sys = DO_UPCAST(FDCtrlSysBus, busdev.qdev, dev);
-    fdctrl = &sys->state;
-    fdctrl->dma_chann = dma_chann; /* FIXME */
-    if (fds[0]) {
-        qdev_prop_set_drive_nofail(dev, "driveA", fds[0]->bdrv);
-    }
-    if (fds[1]) {
-        qdev_prop_set_drive_nofail(dev, "driveB", fds[1]->bdrv);
-    }
-    qdev_init_nofail(dev);
-    sysbus_connect_irq(&sys->busdev, 0, irq);
-    sysbus_mmio_map(&sys->busdev, 0, mmio_base);
-
-    return fdctrl;
-}
-
 FDCtrl *sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
                           DriveInfo **fds, qemu_irq *fdc_tc)
 {
diff --git a/hw/fdc.h b/hw/fdc.h
index 242730a..c99e08a 100644
--- a/hw/fdc.h
+++ b/hw/fdc.h
@@ -7,8 +7,6 @@ 
 typedef struct FDCtrl FDCtrl;
 
 FDCtrl *fdctrl_init_isa(DriveInfo **fds);
-FDCtrl *fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
-                           target_phys_addr_t mmio_base, DriveInfo **fds);
 FDCtrl *sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
                           DriveInfo **fds, qemu_irq *fdc_tc);
 int fdctrl_get_drive_type(FDCtrl *fdctrl, int drive_num);
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index 0af4044..5c66cd4 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -137,7 +137,6 @@  void mips_jazz_init (ram_addr_t ram_size,
     int s_rtc, s_dma_dummy;
     NICInfo *nd;
     PITState *pit;
-    DriveInfo *fds[MAX_FD];
     qemu_irq esp_reset;
     qemu_irq *cpu_exit_irq;
     ram_addr_t ram_offset;
@@ -249,14 +248,7 @@  void mips_jazz_init (ram_addr_t ram_size,
              rc4030[5], &esp_reset);
 
     /* Floppy */
-    if (drive_get_max_bus(IF_FLOPPY) >= MAX_FD) {
-        fprintf(stderr, "qemu: too many floppy drives\n");
-        exit(1);
-    }
-    for (n = 0; n < MAX_FD; n++) {
-        fds[n] = drive_get(IF_FLOPPY, 0, n);
-    }
-    fdctrl_init_sysbus(rc4030[1], 0, 0x80003000, fds);
+    sysbus_create_simple("sysbus-fdc", 0x80003000, rc4030[1]);
 
     /* Real time clock */
     rtc_init(1980, NULL);