Commit 130b0c986836773492c60895bcdb4114964d361a

Authored by balrog
1 parent cce40fcc

Make -mtdblock optional again.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4639 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 6 deletions
hw/nand.c
... ... @@ -450,14 +450,11 @@ struct nand_flash_s *nand_init(int manf_id, int chip_id)
450 450 cpu_abort(cpu_single_env, "%s: Unsupported NAND chip ID.\n",
451 451 __FUNCTION__);
452 452 }
453   - index = drive_get_index(IF_MTD, 0, 0);
454   - if (index == -1) {
455   - cpu_abort(cpu_single_env, "%s: missing MTD device\n",
456   - __FUNCTION__);
457   - }
458 453  
459 454 s = (struct nand_flash_s *) qemu_mallocz(sizeof(struct nand_flash_s));
460   - s->bdrv = drives_table[index].bdrv;
  455 + index = drive_get_index(IF_MTD, 0, 0);
  456 + if (index != -1)
  457 + s->bdrv = drives_table[index].bdrv;
461 458 s->manf_id = manf_id;
462 459 s->chip_id = chip_id;
463 460 s->size = nand_flash_ids[s->chip_id].size << 20;
... ...