summaryrefslogtreecommitdiff
path: root/hw/spitz.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/spitz.c
parentc4f05c8cf715fa613e1985421080e62a7b169284 (diff)
downloadqemu-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.c4
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);