summary refs log tree commit diff stats
path: root/hw/ppc_oldworld.c
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2011-04-03 20:32:46 +0900
committerKevin Wolf <kwolf@redhat.com>2011-04-07 13:51:48 +0200
commit757179038c4884dc43c2ecd0f4da3facb24f262c (patch)
tree76dd8c9d36c5324187b4650d672edb7fb9edb967 /hw/ppc_oldworld.c
parente2982c3a27ab4c0879e61de3c9c57b838f7d0966 (diff)
downloadfocaccia-qemu-757179038c4884dc43c2ecd0f4da3facb24f262c.tar.gz
focaccia-qemu-757179038c4884dc43c2ecd0f4da3facb24f262c.zip
ide: consolidate drive_get(IF_IDE)
factor out ide initialization to call drive_get(IF_IDE)

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ppc_oldworld.c')
-rw-r--r--hw/ppc_oldworld.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index 8a4e088a38..75a312742e 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -236,21 +236,16 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
         pci_nic_init_nofail(&nd_table[i], "ne2k_pci", NULL);
 
 
-    if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) {
-        fprintf(stderr, "qemu: too many IDE bus\n");
-        exit(1);
-    }
+    ide_drive_get(hd, MAX_IDE_BUS);
 
     /* First IDE channel is a MAC IDE on the MacIO bus */
-    hd[0] = drive_get(IF_IDE, 0, 0);
-    hd[1] = drive_get(IF_IDE, 0, 1);
     dbdma = DBDMA_init(&dbdma_mem_index);
     ide_mem_index[0] = -1;
     ide_mem_index[1] = pmac_ide_init(hd, pic[0x0D], dbdma, 0x16, pic[0x02]);
 
     /* Second IDE channel is a CMD646 on the PCI bus */
-    hd[0] = drive_get(IF_IDE, 1, 0);
-    hd[1] = drive_get(IF_IDE, 1, 1);
+    hd[0] = hd[MAX_IDE_DEVS];
+    hd[1] = hd[MAX_IDE_DEVS + 1];
     hd[3] = hd[2] = NULL;
     pci_cmd646_ide_init(pci_bus, hd, 0);