aboutsummaryrefslogtreecommitdiff
path: root/hw/nand.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-07-29 16:35:19 +0100
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-07-30 06:00:45 +0200
commit522f253ca8c731aafc8e53087a18f6015c4e776e (patch)
tree894cdc4ed1e39119e6315a7add5fdb6a95cfa094 /hw/nand.c
parentc4f05c8cf715fa613e1985421080e62a7b169284 (diff)
downloadqemu-522f253ca8c731aafc8e53087a18f6015c4e776e.zip
qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.gz
qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.bz2
hw/nand: Pass block device state to init function
Pass the BlockDeviceState to the nand_init() function rather than having it look it up via drive_get() itself. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/nand.c')
-rw-r--r--hw/nand.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/nand.c b/hw/nand.c
index 37e51d7..d6204d9 100644
--- a/hw/nand.c
+++ b/hw/nand.c
@@ -14,7 +14,6 @@
# include "hw.h"
# include "flash.h"
# include "blockdev.h"
-/* FIXME: Pass block device as an argument. */
# define NAND_CMD_READ0 0x00
# define NAND_CMD_READ1 0x01
@@ -451,20 +450,17 @@ uint8_t nand_getio(NANDFlashState *s)
return *(s->ioaddr ++);
}
-NANDFlashState *nand_init(int manf_id, int chip_id)
+NANDFlashState *nand_init(BlockDriverState *bdrv, int manf_id, int chip_id)
{
int pagesize;
NANDFlashState *s;
- 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));
- dinfo = drive_get(IF_MTD, 0, 0);
- if (dinfo)
- s->bdrv = dinfo->bdrv;
+ s->bdrv = bdrv;
s->manf_id = manf_id;
s->chip_id = chip_id;
s->size = nand_flash_ids[s->chip_id].size << 20;