From 522f253ca8c731aafc8e53087a18f6015c4e776e Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 29 Jul 2011 16:35:19 +0100 Subject: 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 Signed-off-by: Andrzej Zaborowski --- hw/spitz.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'hw/spitz.c') 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); -- cgit v1.2.3