aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc_oldworld.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/ppc_oldworld.c')
-rw-r--r--hw/ppc_oldworld.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index 56b2876684..7931f44088 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -135,7 +135,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
int escc_mem_index, ide_mem_index[2];
uint16_t ppc_boot_device;
BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
- int index;
+ DriveInfo *dinfo;
void *fw_cfg;
void *dbdma;
uint8_t *vga_bios_ptr;
@@ -328,31 +328,19 @@ static void ppc_heathrow_init (ram_addr_t ram_size,
}
/* First IDE channel is a MAC IDE on the MacIO bus */
- index = drive_get_index(IF_IDE, 0, 0);
- if (index == -1)
- hd[0] = NULL;
- else
- hd[0] = drives_table[index].bdrv;
- index = drive_get_index(IF_IDE, 0, 1);
- if (index == -1)
- hd[1] = NULL;
- else
- hd[1] = drives_table[index].bdrv;
+ dinfo = drive_get(IF_IDE, 0, 0);
+ hd[0] = dinfo ? dinfo->bdrv : NULL;
+ dinfo = drive_get(IF_IDE, 0, 1);
+ hd[1] = dinfo ? dinfo->bdrv : NULL;
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 */
- index = drive_get_index(IF_IDE, 1, 0);
- if (index == -1)
- hd[0] = NULL;
- else
- hd[0] = drives_table[index].bdrv;
- index = drive_get_index(IF_IDE, 1, 1);
- if (index == -1)
- hd[1] = NULL;
- else
- hd[1] = drives_table[index].bdrv;
+ dinfo = drive_get(IF_IDE, 1, 0);
+ hd[0] = dinfo ? dinfo->bdrv : NULL;
+ dinfo = drive_get(IF_IDE, 1, 1);
+ hd[1] = dinfo ? dinfo->bdrv : NULL;
hd[3] = hd[2] = NULL;
pci_cmd646_ide_init(pci_bus, hd, 0);