diff options
author | Peter Maydell | 2011-07-29 17:35:19 +0200 |
---|---|---|
committer | Andrzej Zaborowski | 2011-07-30 06:00:45 +0200 |
commit | 522f253ca8c731aafc8e53087a18f6015c4e776e (patch) | |
tree | 894cdc4ed1e39119e6315a7add5fdb6a95cfa094 /hw/tc6393xb.c | |
parent | lm832x: Take DeviceState pointer in lm832x_key_event() (diff) | |
download | qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.gz qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.xz qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.zip |
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/tc6393xb.c')
-rw-r--r-- | hw/tc6393xb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hw/tc6393xb.c b/hw/tc6393xb.c index ed49e944df..4de081966b 100644 --- a/hw/tc6393xb.c +++ b/hw/tc6393xb.c @@ -12,6 +12,7 @@ #include "flash.h" #include "console.h" #include "pixel_ops.h" +#include "blockdev.h" #define IRQ_TC6393_NAND 0 #define IRQ_TC6393_MMC 1 @@ -566,6 +567,7 @@ TC6393xbState *tc6393xb_init(uint32_t base, qemu_irq irq) { int iomemtype; TC6393xbState *s; + DriveInfo *nand; CPUReadMemoryFunc * const tc6393xb_readfn[] = { tc6393xb_readb, tc6393xb_readw, @@ -586,7 +588,8 @@ TC6393xbState *tc6393xb_init(uint32_t base, qemu_irq irq) s->sub_irqs = qemu_allocate_irqs(tc6393xb_sub_irq, s, TC6393XB_NR_IRQS); - s->flash = nand_init(NAND_MFR_TOSHIBA, 0x76); + nand = drive_get(IF_MTD, 0, 0); + s->flash = nand_init(nand ? nand->bdrv : NULL, NAND_MFR_TOSHIBA, 0x76); iomemtype = cpu_register_io_memory(tc6393xb_readfn, tc6393xb_writefn, s, DEVICE_NATIVE_ENDIAN); |