Revision 751c6a17 hw/pxa2xx.c

b/hw/pxa2xx.c
2034 2034
{
2035 2035
    PXA2xxState *s;
2036 2036
    int iomemtype, i;
2037
    int index;
2037
    DriveInfo *dinfo;
2038 2038
    s = (PXA2xxState *) qemu_mallocz(sizeof(PXA2xxState));
2039 2039

  
2040 2040
    if (revision && strncmp(revision, "pxa27", 5)) {
......
2066 2066

  
2067 2067
    s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121);
2068 2068

  
2069
    index = drive_get_index(IF_SD, 0, 0);
2070
    if (index == -1) {
2069
    dinfo = drive_get(IF_SD, 0, 0);
2070
    if (!dinfo) {
2071 2071
        fprintf(stderr, "qemu: missing SecureDigital device\n");
2072 2072
        exit(1);
2073 2073
    }
2074
    s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv,
2074
    s->mmc = pxa2xx_mmci_init(0x41100000, dinfo->bdrv,
2075 2075
                              s->pic[PXA2XX_PIC_MMC], s->dma);
2076 2076

  
2077 2077
    for (i = 0; pxa270_serial[i].io_base; i ++)
......
2153 2153
{
2154 2154
    PXA2xxState *s;
2155 2155
    int iomemtype, i;
2156
    int index;
2156
    DriveInfo *dinfo;
2157 2157

  
2158 2158
    s = (PXA2xxState *) qemu_mallocz(sizeof(PXA2xxState));
2159 2159

  
......
2178 2178

  
2179 2179
    s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85);
2180 2180

  
2181
    index = drive_get_index(IF_SD, 0, 0);
2182
    if (index == -1) {
2181
    dinfo = drive_get(IF_SD, 0, 0);
2182
    if (!dinfo) {
2183 2183
        fprintf(stderr, "qemu: missing SecureDigital device\n");
2184 2184
        exit(1);
2185 2185
    }
2186
    s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv,
2186
    s->mmc = pxa2xx_mmci_init(0x41100000, dinfo->bdrv,
2187 2187
                              s->pic[PXA2XX_PIC_MMC], s->dma);
2188 2188

  
2189 2189
    for (i = 0; pxa255_serial[i].io_base; i ++)

Also available in: Unified diff