Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358436
b: refs/heads/master
c: cc7ba39
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas committed Feb 12, 2013
1 parent b214ec3 commit 80135d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd6dceab017e6be6c158dc56ec6dacf817f21a5b
refs/heads/master: cc7ba39bab126339d6d525ada07dea5633d71521
4 changes: 2 additions & 2 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ static int __pci_enable_device_flags(struct pci_dev *dev,
dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
}

if (atomic_add_return(1, &dev->enable_cnt) > 1)
if (atomic_inc_return(&dev->enable_cnt) > 1)
return 0; /* already enabled */

/* only skip sriov related */
Expand Down Expand Up @@ -1404,7 +1404,7 @@ pci_disable_device(struct pci_dev *dev)
dev_WARN_ONCE(&dev->dev, atomic_read(&dev->enable_cnt) <= 0,
"disabling already-disabled device");

if (atomic_sub_return(1, &dev->enable_cnt) != 0)
if (atomic_dec_return(&dev->enable_cnt) != 0)
return;

do_pci_disable_device(dev);
Expand Down

0 comments on commit 80135d2

Please sign in to comment.