aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index b099e0025d2b..a899d8bb190d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -646,15 +646,11 @@ static int pci_platform_power_transition(struct pci_dev *dev, pci_power_t state)
646 error = platform_pci_set_power_state(dev, state); 646 error = platform_pci_set_power_state(dev, state);
647 if (!error) 647 if (!error)
648 pci_update_current_state(dev, state); 648 pci_update_current_state(dev, state);
649 /* Fall back to PCI_D0 if native PM is not supported */ 649 } else
650 if (!dev->pm_cap)
651 dev->current_state = PCI_D0;
652 } else {
653 error = -ENODEV; 650 error = -ENODEV;
654 /* Fall back to PCI_D0 if native PM is not supported */ 651
655 if (!dev->pm_cap) 652 if (error && !dev->pm_cap) /* Fall back to PCI_D0 */
656 dev->current_state = PCI_D0; 653 dev->current_state = PCI_D0;
657 }
658 654
659 return error; 655 return error;
660} 656}
@@ -1575,7 +1571,7 @@ void pci_pme_active(struct pci_dev *dev, bool enable)
1575{ 1571{
1576 u16 pmcsr; 1572 u16 pmcsr;
1577 1573
1578 if (!dev->pm_cap) 1574 if (!dev->pme_support)
1579 return; 1575 return;
1580 1576
1581 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr); 1577 pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
@@ -1924,6 +1920,7 @@ void pci_pm_init(struct pci_dev *dev)
1924 dev->wakeup_prepared = false; 1920 dev->wakeup_prepared = false;
1925 1921
1926 dev->pm_cap = 0; 1922 dev->pm_cap = 0;
1923 dev->pme_support = 0;
1927 1924
1928 /* find PCI PM capability in list */ 1925 /* find PCI PM capability in list */
1929 pm = pci_find_capability(dev, PCI_CAP_ID_PM); 1926 pm = pci_find_capability(dev, PCI_CAP_ID_PM);
@@ -1975,8 +1972,6 @@ void pci_pm_init(struct pci_dev *dev)
1975 device_set_wakeup_capable(&dev->dev, true); 1972 device_set_wakeup_capable(&dev->dev, true);
1976 /* Disable the PME# generation functionality */ 1973 /* Disable the PME# generation functionality */
1977 pci_pme_active(dev, false); 1974 pci_pme_active(dev, false);
1978 } else {
1979 dev->pme_support = 0;
1980 } 1975 }
1981} 1976}
1982 1977
@@ -2619,7 +2614,7 @@ void pci_release_selected_regions(struct pci_dev *pdev, int bars)
2619 pci_release_region(pdev, i); 2614 pci_release_region(pdev, i);
2620} 2615}
2621 2616
2622int __pci_request_selected_regions(struct pci_dev *pdev, int bars, 2617static int __pci_request_selected_regions(struct pci_dev *pdev, int bars,
2623 const char *res_name, int excl) 2618 const char *res_name, int excl)
2624{ 2619{
2625 int i; 2620 int i;
@@ -3699,7 +3694,7 @@ static DEFINE_SPINLOCK(resource_alignment_lock);
3699 * RETURNS: Resource alignment if it is specified. 3694 * RETURNS: Resource alignment if it is specified.
3700 * Zero if it is not specified. 3695 * Zero if it is not specified.
3701 */ 3696 */
3702resource_size_t pci_specified_resource_alignment(struct pci_dev *dev) 3697static resource_size_t pci_specified_resource_alignment(struct pci_dev *dev)
3703{ 3698{
3704 int seg, bus, slot, func, align_order, count; 3699 int seg, bus, slot, func, align_order, count;
3705 resource_size_t align = 0; 3700 resource_size_t align = 0;
@@ -3812,7 +3807,7 @@ void pci_reassigndev_resource_alignment(struct pci_dev *dev)
3812 } 3807 }
3813} 3808}
3814 3809
3815ssize_t pci_set_resource_alignment_param(const char *buf, size_t count) 3810static ssize_t pci_set_resource_alignment_param(const char *buf, size_t count)
3816{ 3811{
3817 if (count > RESOURCE_ALIGNMENT_PARAM_SIZE - 1) 3812 if (count > RESOURCE_ALIGNMENT_PARAM_SIZE - 1)
3818 count = RESOURCE_ALIGNMENT_PARAM_SIZE - 1; 3813 count = RESOURCE_ALIGNMENT_PARAM_SIZE - 1;
@@ -3823,7 +3818,7 @@ ssize_t pci_set_resource_alignment_param(const char *buf, size_t count)
3823 return count; 3818 return count;
3824} 3819}
3825 3820
3826ssize_t pci_get_resource_alignment_param(char *buf, size_t size) 3821static ssize_t pci_get_resource_alignment_param(char *buf, size_t size)
3827{ 3822{
3828 size_t count; 3823 size_t count;
3829 spin_lock(&resource_alignment_lock); 3824 spin_lock(&resource_alignment_lock);