Patchwork [11/12] ide: cmd646 ->unit has just the value that we want

login
register
mail settings
Submitter Juan Quintela
Date Oct. 7, 2009, 2:56 p.m.
Message ID <c3e0f94ccfe958eded97dc294fda754a5186986f.1254927187.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/35307/
State Under Review
Headers show

Comments

Juan Quintela - Oct. 7, 2009, 2:56 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/ide/cmd646.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index a36c3b5..4af1954 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -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;