Skip to contentSkip to conversation

[4639] Make -mtdblock optional again.

Qemu-devel Andrzej Zaborowski 1 participant 1 message Jun 2, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 4639

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4639
Author:   balrog
Date:     2008-06-02 00:39:30 +0000 (Mon, 02 Jun 2008)

Log Message:
-----------
Make -mtdblock optional again.

Modified Paths:
--------------
trunk/hw/nand.c

Modified: trunk/hw/nand.c
===================================================================

hw/nand.c +3 -6
@@ -450,14 +450,11 @@
         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;