Skip to content

Commit

Permalink
PCI: Rename pci_is_bridge() to pci_has_subordinate()
Browse files Browse the repository at this point in the history
Previously, pci_is_bridge() returned true only when a subordinate bus
existed.  Rename pci_is_bridge() to pci_has_subordinate() to better
indicate what we're checking.

No functional change.

[bhelgaas: changelog]
Signed-off-by: Yijing Wang <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
  • Loading branch information
YijingWang authored and bjorn-helgaas committed May 27, 2014
1 parent c9eaa44 commit 326c1cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,14 +580,14 @@ static void pci_pm_default_resume(struct pci_dev *pci_dev)
{
pci_fixup_device(pci_fixup_resume, pci_dev);

if (!pci_is_bridge(pci_dev))
if (!pci_has_subordinate(pci_dev))
pci_enable_wake(pci_dev, PCI_D0, false);
}

static void pci_pm_default_suspend(struct pci_dev *pci_dev)
{
/* Disable non-bridge devices without PM support */
if (!pci_is_bridge(pci_dev))
if (!pci_has_subordinate(pci_dev))
pci_disable_enabled_device(pci_dev);
}

Expand Down Expand Up @@ -717,7 +717,7 @@ static int pci_pm_suspend_noirq(struct device *dev)

if (!pci_dev->state_saved) {
pci_save_state(pci_dev);
if (!pci_is_bridge(pci_dev))
if (!pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);
}

Expand Down Expand Up @@ -971,7 +971,7 @@ static int pci_pm_poweroff_noirq(struct device *dev)
return error;
}

if (!pci_dev->state_saved && !pci_is_bridge(pci_dev))
if (!pci_dev->state_saved && !pci_has_subordinate(pci_dev))
pci_prepare_to_sleep(pci_dev);

/*
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static inline void pci_wakeup_event(struct pci_dev *dev)
pm_wakeup_event(&dev->dev, 100);
}

static inline bool pci_is_bridge(struct pci_dev *pci_dev)
static inline bool pci_has_subordinate(struct pci_dev *pci_dev)
{
return !!(pci_dev->subordinate);
}
Expand Down

0 comments on commit 326c1cd

Please sign in to comment.