ide: cmd646 ->unit has just the value that we want
authorJuan Quintela <quintela@redhat.com>
Wed, 7 Oct 2009 14:56:28 +0000 (16:56 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 12 Oct 2009 14:42:31 +0000 (09:42 -0500)
Patchworks-ID: 35307
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
hw/ide/cmd646.c

index eb5a2e9..3b5362d 100644 (file)
@@ -94,7 +94,7 @@ static uint32_t bmdma_readb(void *opaque, uint32_t addr)
         val = bm->status;
         break;
     case 3:
-        if (bm == &pci_dev->bmdma[0]) {
+        if (bm->unit == 0) {
             val = pci_dev->dev.config[UDIDETCR0];
         } else {
             val = pci_dev->dev.config[UDIDETCR1];
@@ -127,7 +127,7 @@ static void bmdma_writeb(void *opaque, uint32_t addr, uint32_t val)
         bm->status = (val & 0x60) | (bm->status & 1) | (bm->status & ~val & 0x06);
         break;
     case 3:
-        if (bm == &pci_dev->bmdma[0])
+        if (bm->unit == 0)
             pci_dev->dev.config[UDIDETCR0] = val;
         else
             pci_dev->dev.config[UDIDETCR1] = val;