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 | 5bcc433461edf45a2e20a4489454e182172e580d (patch) | |
tree | 61a769ed1a1c16ebdfc1397ce9d775222dfa8e57 /hw/nand.c | |
parent | 3a3263d268bb81b52676f2e8997e3a079640cc0b (diff) | |
download | qemu-5bcc433461edf45a2e20a4489454e182172e580d.tar.gz qemu-5bcc433461edf45a2e20a4489454e182172e580d.tar.bz2 qemu-5bcc433461edf45a2e20a4489454e182172e580d.zip |
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/nand.c')
-rw-r--r-- | hw/nand.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -442,16 +442,16 @@ NANDFlashState *nand_init(int manf_id, int chip_id) { int pagesize; NANDFlashState *s; - int index; + DriveInfo *dinfo; if (nand_flash_ids[chip_id].size == 0) { hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__); } s = (NANDFlashState *) qemu_mallocz(sizeof(NANDFlashState)); - index = drive_get_index(IF_MTD, 0, 0); - if (index != -1) - s->bdrv = drives_table[index].bdrv; + dinfo = drive_get(IF_MTD, 0, 0); + if (dinfo) + s->bdrv = dinfo->bdrv; s->manf_id = manf_id; s->chip_id = chip_id; s->size = nand_flash_ids[s->chip_id].size << 20; |