aboutsummaryrefslogtreecommitdiff
path: root/hw/nand.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-02 00:39:30 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-02 00:39:30 +0000
commit130b0c986836773492c60895bcdb4114964d361a (patch)
treec74e624924c32beac98451848280f3a683cb2159 /hw/nand.c
parentcce40fccbd4d101b4daa1cc1c204df1172ca0dc4 (diff)
downloadqemu-130b0c986836773492c60895bcdb4114964d361a.zip
qemu-130b0c986836773492c60895bcdb4114964d361a.tar.gz
qemu-130b0c986836773492c60895bcdb4114964d361a.tar.bz2
Make -mtdblock optional again.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4639 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/nand.c')
-rw-r--r--hw/nand.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/nand.c b/hw/nand.c
index ea353ed..aa0c200 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -450,14 +450,11 @@ struct nand_flash_s *nand_init(int manf_id, int chip_id)
cpu_abort(cpu_single_env, "%s: Unsupported NAND chip ID.\n",
__FUNCTION__);
}
- index = drive_get_index(IF_MTD, 0, 0);
- if (index == -1) {
- cpu_abort(cpu_single_env, "%s: missing MTD device\n",
- __FUNCTION__);
- }
s = (struct nand_flash_s *) qemu_mallocz(sizeof(struct nand_flash_s));
- s->bdrv = drives_table[index].bdrv;
+ index = drive_get_index(IF_MTD, 0, 0);
+ if (index != -1)
+ s->bdrv = drives_table[index].bdrv;
s->manf_id = manf_id;
s->chip_id = chip_id;
s->size = nand_flash_ids[s->chip_id].size << 20;