Patchwork [v5,03/14] pci: use pci_word_test_and_clear_mask() in pci_device_reset()

login
register
mail settings
Submitter Isaku Yamahata
Date Oct. 19, 2010, 9:06 a.m.
Message ID <d6055d1babe93f094bac3cd25df7328d95dff246.1287478251.git.yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/68287/
State New
Headers show

Comments

Isaku Yamahata - Oct. 19, 2010, 9:06 a.m.
use pci_clear_bit_word() in pci_device_reset() where appropriate.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
Changes v4 -> v5
- use pci_word_test_and_clear_mask()
---
 hw/pci.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/pci.c b/hw/pci.c
index 300079f..409e2c0 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -139,9 +139,8 @@  static void pci_device_reset(PCIDevice *dev)
     dev->irq_state = 0;
     pci_update_irq_status(dev);
     /* Clear all writeable bits */
-    pci_set_word(dev->config + PCI_COMMAND,
-                 pci_get_word(dev->config + PCI_COMMAND) &
-                 ~pci_get_word(dev->wmask + PCI_COMMAND));
+    pci_word_test_and_clear_mask(dev->config + PCI_COMMAND,
+                                 pci_get_word(dev->wmask + PCI_COMMAND));
     dev->config[PCI_CACHE_LINE_SIZE] = 0x0;
     dev->config[PCI_INTERRUPT_LINE] = 0x0;
     for (r = 0; r < PCI_NUM_REGIONS; ++r) {