diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2011-07-29 16:35:19 +0100 |
---|---|---|
committer | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2011-07-30 06:00:45 +0200 |
commit | 522f253ca8c731aafc8e53087a18f6015c4e776e (patch) | |
tree | 894cdc4ed1e39119e6315a7add5fdb6a95cfa094 /hw/spitz.c | |
parent | c4f05c8cf715fa613e1985421080e62a7b169284 (diff) | |
download | qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.gz qemu-522f253ca8c731aafc8e53087a18f6015c4e776e.tar.bz2 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/spitz.c')
-rw-r--r-- | hw/spitz.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/hw/spitz.c b/hw/spitz.c index 006f7a97e3..78e9c34592 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -169,11 +169,13 @@ static void sl_flash_register(PXA2xxState *cpu, int size) static int sl_nand_init(SysBusDevice *dev) { int iomemtype; SLNANDState *s; + DriveInfo *nand; s = FROM_SYSBUS(SLNANDState, dev); s->ctl = 0; - s->nand = nand_init(s->manf_id, s->chip_id); + nand = drive_get(IF_MTD, 0, 0); + s->nand = nand_init(nand ? nand->bdrv : NULL, s->manf_id, s->chip_id); iomemtype = cpu_register_io_memory(sl_readfn, sl_writefn, s, DEVICE_NATIVE_ENDIAN); |