Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142749
b: refs/heads/master
c: 296ccb0
h: refs/heads/master
i:
  142747: bfcadac
v: v3
  • Loading branch information
Yuji Shimada authored and Jesse Barnes committed Apr 6, 2009
1 parent f6344ec commit 9573672
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 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: 7eb93b175d4de9438a4b0af3a94a112cb5266944
refs/heads/master: 296ccb086dfb89b5b8d73ef08c795ffdff12a597
2 changes: 1 addition & 1 deletion trunk/drivers/pci/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void pci_enable_bridges(struct pci_bus *bus)

list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->subordinate) {
if (atomic_read(&dev->enable_cnt) == 0) {
if (!pci_is_enabled(dev)) {
retval = pci_enable_device(dev);
pci_set_master(dev);
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/pci-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static ssize_t is_enabled_store(struct device *dev,
return -EPERM;

if (!val) {
if (atomic_read(&pdev->enable_cnt) != 0)
if (pci_is_enabled(pdev))
pci_disable_device(pdev);
else
result = -EIO;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars)
*/
int pci_reenable_device(struct pci_dev *dev)
{
if (atomic_read(&dev->enable_cnt))
if (pci_is_enabled(dev))
return do_pci_enable_device(dev, (1 << PCI_NUM_RESOURCES) - 1);
return 0;
}
Expand Down Expand Up @@ -1042,7 +1042,7 @@ static void do_pci_disable_device(struct pci_dev *dev)
*/
void pci_disable_enabled_device(struct pci_dev *dev)
{
if (atomic_read(&dev->enable_cnt))
if (pci_is_enabled(dev))
do_pci_disable_device(dev);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pci/setup-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void pci_setup_bridge(struct pci_bus *bus)
struct pci_bus_region region;
u32 l, bu, lu, io_upper16;

if (!pci_is_root_bus(bus) && bus->is_added)
if (pci_is_enabled(bridge))
return;

dev_info(&bridge->dev, "PCI bridge, secondary bus %04x:%02x\n",
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,11 @@ int __must_check pci_reenable_device(struct pci_dev *);
int __must_check pcim_enable_device(struct pci_dev *pdev);
void pcim_pin_device(struct pci_dev *pdev);

static inline int pci_is_enabled(struct pci_dev *pdev)
{
return (atomic_read(&pdev->enable_cnt) > 0);
}

static inline int pci_is_managed(struct pci_dev *pdev)
{
return pdev->is_managed;
Expand Down

0 comments on commit 9573672

Please sign in to comment.