From 124386cc756f6a7975562d652d0e98a379292138 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 3 Aug 2011 15:08:13 +0200 Subject: spitz tosa: Simplify "drive is suitable for microdrive" test We try the drive defined with -drive if=ide,index=0 (or equivalent sugar). We use it only if (dinfo && bdrv_is_inserted(dinfo->bdrv) && !bdrv_is_removable(dinfo->bdrv)). This is a convoluted way to test for "drive media can't be removed". The only way to create such a drive with -drive if=ide is media=cdrom. And that sets dinfo->media_cd, so just test that. Signed-off-by: Markus Armbruster Signed-off-by: Kevin Wolf --- hw/tosa.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'hw/tosa.c') diff --git a/hw/tosa.c b/hw/tosa.c index a7967a286..7b407f4f6 100644 --- a/hw/tosa.c +++ b/hw/tosa.c @@ -51,17 +51,13 @@ static void tosa_microdrive_attach(PXA2xxState *cpu) { PCMCIACardState *md; - BlockDriverState *bs; DriveInfo *dinfo; dinfo = drive_get(IF_IDE, 0, 0); - if (!dinfo) + if (!dinfo || dinfo->media_cd) return; - bs = dinfo->bdrv; - if (bdrv_is_inserted(bs) && !bdrv_is_removable(bs)) { - md = dscm1xxxx_init(dinfo); - pxa2xx_pcmcia_attach(cpu->pcmcia[0], md); - } + md = dscm1xxxx_init(dinfo); + pxa2xx_pcmcia_attach(cpu->pcmcia[0], md); } static void tosa_out_switch(void *opaque, int line, int level) -- cgit v1.2.3