diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-07-22 16:42:57 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-27 14:08:23 -0500 |
commit | 751c6a17042b5d011013d6963c0505d671cf708e (patch) | |
tree | 61a769ed1a1c16ebdfc1397ce9d775222dfa8e57 /hw/pxa2xx.c | |
parent | 8a14daa5a1ae22fcfc317f4727a88d6c15c39aae (diff) |
kill drives_table
First step cleaning up the drives handling. This one does nothing but
removing drives_table[], still it became seriously big.
drive_get_index() is gone and is replaced by drives_get() which hands
out DriveInfo pointers instead of a table index. This needs adaption in
*tons* of places all over.
The drives are now maintained as linked list.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pxa2xx.c')
-rw-r--r-- | hw/pxa2xx.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c index f2e98ffc24..28e9610ef2 100644 --- a/hw/pxa2xx.c +++ b/hw/pxa2xx.c @@ -2034,7 +2034,7 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) { PXA2xxState *s; int iomemtype, i; - int index; + DriveInfo *dinfo; s = (PXA2xxState *) qemu_mallocz(sizeof(PXA2xxState)); if (revision && strncmp(revision, "pxa27", 5)) { @@ -2066,12 +2066,12 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *revision) s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 121); - index = drive_get_index(IF_SD, 0, 0); - if (index == -1) { + dinfo = drive_get(IF_SD, 0, 0); + if (!dinfo) { fprintf(stderr, "qemu: missing SecureDigital device\n"); exit(1); } - s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv, + s->mmc = pxa2xx_mmci_init(0x41100000, dinfo->bdrv, s->pic[PXA2XX_PIC_MMC], s->dma); for (i = 0; pxa270_serial[i].io_base; i ++) @@ -2153,7 +2153,7 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) { PXA2xxState *s; int iomemtype, i; - int index; + DriveInfo *dinfo; s = (PXA2xxState *) qemu_mallocz(sizeof(PXA2xxState)); @@ -2178,12 +2178,12 @@ PXA2xxState *pxa255_init(unsigned int sdram_size) s->gpio = pxa2xx_gpio_init(0x40e00000, s->env, s->pic, 85); - index = drive_get_index(IF_SD, 0, 0); - if (index == -1) { + dinfo = drive_get(IF_SD, 0, 0); + if (!dinfo) { fprintf(stderr, "qemu: missing SecureDigital device\n"); exit(1); } - s->mmc = pxa2xx_mmci_init(0x41100000, drives_table[index].bdrv, + s->mmc = pxa2xx_mmci_init(0x41100000, dinfo->bdrv, s->pic[PXA2XX_PIC_MMC], s->dma); for (i = 0; pxa255_serial[i].io_base; i ++) |