Revision 751c6a17 hw/mainstone.c

b/hw/mainstone.c
77 77
    target_phys_addr_t mainstone_flash_base[] = { MST_FLASH_0, MST_FLASH_1 };
78 78
    PXA2xxState *cpu;
79 79
    qemu_irq *mst_irq;
80
    int i, index;
80
    DriveInfo *dinfo;
81
    int i;
81 82

  
82 83
    if (!cpu_model)
83 84
        cpu_model = "pxa270-c5";
......
92 93

  
93 94
    /* There are two 32MiB flash devices on the board */
94 95
    for (i = 0; i < 2; i ++) {
95
        index = drive_get_index(IF_PFLASH, 0, i);
96
        if (index == -1) {
96
        dinfo = drive_get(IF_PFLASH, 0, i);
97
        if (!dinfo) {
97 98
            fprintf(stderr, "Two flash images must be given with the "
98 99
                    "'pflash' parameter\n");
99 100
            exit(1);
......
101 102

  
102 103
        if (!pflash_cfi01_register(mainstone_flash_base[i],
103 104
                                qemu_ram_alloc(MAINSTONE_FLASH),
104
                                drives_table[index].bdrv, sector_len,
105
                                dinfo->bdrv, sector_len,
105 106
                                MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0)) {
106 107
            fprintf(stderr, "qemu: Error registering flash memory.\n");
107 108
            exit(1);

Also available in: Unified diff