diff options
author | Isaku Yamahata <yamahata@valinux.co.jp> | 2011-04-03 20:32:46 +0900 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2011-04-07 13:51:48 +0200 |
commit | 757179038c4884dc43c2ecd0f4da3facb24f262c (patch) | |
tree | 76dd8c9d36c5324187b4650d672edb7fb9edb967 /hw/ppc_newworld.c | |
parent | e2982c3a27ab4c0879e61de3c9c57b838f7d0966 (diff) |
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_newworld.c')
-rw-r--r-- | hw/ppc_newworld.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c index b9245f066a..86f1cfbee9 100644 --- a/hw/ppc_newworld.c +++ b/hw/ppc_newworld.c @@ -325,20 +325,13 @@ static void ppc_core99_init (ram_addr_t ram_size, for(i = 0; i < nb_nics; i++) 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); dbdma = DBDMA_init(&dbdma_mem_index); /* We only emulate 2 out of 3 IDE controllers for now */ ide_mem_index[0] = -1; - hd[0] = drive_get(IF_IDE, 0, 0); - hd[1] = drive_get(IF_IDE, 0, 1); ide_mem_index[1] = pmac_ide_init(hd, pic[0x0d], dbdma, 0x16, pic[0x02]); - hd[0] = drive_get(IF_IDE, 1, 0); - hd[1] = drive_get(IF_IDE, 1, 1); - ide_mem_index[2] = pmac_ide_init(hd, pic[0x0e], dbdma, 0x1a, pic[0x02]); + ide_mem_index[2] = pmac_ide_init(&hd[MAX_IDE_DEVS], pic[0x0e], dbdma, 0x1a, pic[0x02]); /* cuda also initialize ADB */ if (machine_arch == ARCH_MAC99_U3) { |