Commit 5dc07a20 authored by Bjorn Helgaas's avatar Bjorn Helgaas

Merge branch 'pci/misc'

- Check pcie_find_root_port() return in x86 fixups to avoid NULL pointer
  dereferences (Samasth Norway Ananda)

- Make pci_bus_type constant (Kunwu Chan)

- Remove unused declarations of __pci_pme_wakeup() and pci_vpd_release()
  (Yue Haibing)

- Remove any leftover .*.cmd files with make clean (zhang jiao)

* pci/misc:
  PCI: Fix typos
  PCI/VPD: Remove pci_vpd_release() unused declarations
  PCI/PM: Remove __pci_pme_wakeup() unused declarations
  PCI: Make pci_bus_type constant
  x86/PCI: Check pcie_find_root_port() return for NULL
parents ca5c6568 5c7bdac7
...@@ -980,7 +980,7 @@ static void amd_rp_pme_suspend(struct pci_dev *dev) ...@@ -980,7 +980,7 @@ static void amd_rp_pme_suspend(struct pci_dev *dev)
return; return;
rp = pcie_find_root_port(dev); rp = pcie_find_root_port(dev);
if (!rp->pm_cap) if (!rp || !rp->pm_cap)
return; return;
rp->pme_support &= ~((PCI_PM_CAP_PME_D3hot|PCI_PM_CAP_PME_D3cold) >> rp->pme_support &= ~((PCI_PM_CAP_PME_D3hot|PCI_PM_CAP_PME_D3cold) >>
...@@ -994,7 +994,7 @@ static void amd_rp_pme_resume(struct pci_dev *dev) ...@@ -994,7 +994,7 @@ static void amd_rp_pme_resume(struct pci_dev *dev)
u16 pmc; u16 pmc;
rp = pcie_find_root_port(dev); rp = pcie_find_root_port(dev);
if (!rp->pm_cap) if (!rp || !rp->pm_cap)
return; return;
pci_read_config_word(rp, rp->pm_cap + PCI_PM_PMC, &pmc); pci_read_config_word(rp, rp->pm_cap + PCI_PM_PMC, &pmc);
......
...@@ -455,8 +455,8 @@ void pci_restore_pasid_state(struct pci_dev *pdev) ...@@ -455,8 +455,8 @@ void pci_restore_pasid_state(struct pci_dev *pdev)
* pci_pasid_features - Check which PASID features are supported * pci_pasid_features - Check which PASID features are supported
* @pdev: PCI device structure * @pdev: PCI device structure
* *
* Returns a negative value when no PASI capability is present. * Return a negative value when no PASID capability is present.
* Otherwise is returns a bitmask with supported features. Current * Otherwise return a bitmask with supported features. Current
* features reported are: * features reported are:
* PCI_PASID_CAP_EXEC - Execute permission supported * PCI_PASID_CAP_EXEC - Execute permission supported
* PCI_PASID_CAP_PRIV - Privileged mode supported * PCI_PASID_CAP_PRIV - Privileged mode supported
......
...@@ -328,7 +328,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) ...@@ -328,7 +328,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot)
} else { } else {
/* Did not get a match on the target PCI device. Check /* Did not get a match on the target PCI device. Check
* if the current IRQ table entry is a PCI-to-PCI * if the current IRQ table entry is a PCI-to-PCI
* bridge device. If so, and it's secondary bus * bridge device. If so, and its secondary bus
* matches the bus number for the target device, I need * matches the bus number for the target device, I need
* to save the bridge's slot number. If I can not find * to save the bridge's slot number. If I can not find
* an entry for the target device, I will have to * an entry for the target device, I will have to
......
...@@ -112,7 +112,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -112,7 +112,7 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
{ {
/* if the slot exits it always contains a function */ /* if the slot exists it always contains a function */
*value = 1; *value = 1;
return 0; return 0;
} }
......
...@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(pci_iomap_wc); ...@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(pci_iomap_wc);
* the different IOMAP ranges. * the different IOMAP ranges.
* *
* But if the architecture does not use the generic iomap code, and if * But if the architecture does not use the generic iomap code, and if
* it has _not_ defined it's own private pci_iounmap function, we define * it has _not_ defined its own private pci_iounmap function, we define
* it here. * it here.
* *
* NOTE! This default implementation assumes that if the architecture * NOTE! This default implementation assumes that if the architecture
......
...@@ -1670,7 +1670,7 @@ static void pci_dma_cleanup(struct device *dev) ...@@ -1670,7 +1670,7 @@ static void pci_dma_cleanup(struct device *dev)
iommu_device_unuse_default_domain(dev); iommu_device_unuse_default_domain(dev);
} }
struct bus_type pci_bus_type = { const struct bus_type pci_bus_type = {
.name = "pci", .name = "pci",
.match = pci_bus_match, .match = pci_bus_match,
.uevent = pci_uevent, .uevent = pci_uevent,
......
...@@ -139,7 +139,6 @@ void pcie_clear_device_status(struct pci_dev *dev); ...@@ -139,7 +139,6 @@ void pcie_clear_device_status(struct pci_dev *dev);
void pcie_clear_root_pme_status(struct pci_dev *dev); void pcie_clear_root_pme_status(struct pci_dev *dev);
bool pci_check_pme_status(struct pci_dev *dev); bool pci_check_pme_status(struct pci_dev *dev);
void pci_pme_wakeup_bus(struct pci_bus *bus); void pci_pme_wakeup_bus(struct pci_bus *bus);
int __pci_pme_wakeup(struct pci_dev *dev, void *ign);
void pci_pme_restore(struct pci_dev *dev); void pci_pme_restore(struct pci_dev *dev);
bool pci_dev_need_resume(struct pci_dev *dev); bool pci_dev_need_resume(struct pci_dev *dev);
void pci_dev_adjust_pme(struct pci_dev *dev); void pci_dev_adjust_pme(struct pci_dev *dev);
...@@ -189,7 +188,6 @@ static inline bool pcie_downstream_port(const struct pci_dev *dev) ...@@ -189,7 +188,6 @@ static inline bool pcie_downstream_port(const struct pci_dev *dev)
} }
void pci_vpd_init(struct pci_dev *dev); void pci_vpd_init(struct pci_dev *dev);
void pci_vpd_release(struct pci_dev *dev);
extern const struct attribute_group pci_dev_vpd_attr_group; extern const struct attribute_group pci_dev_vpd_attr_group;
/* PCI Virtual Channel */ /* PCI Virtual Channel */
......
...@@ -1102,7 +1102,7 @@ enum pcie_bus_config_types { ...@@ -1102,7 +1102,7 @@ enum pcie_bus_config_types {
extern enum pcie_bus_config_types pcie_bus_config; extern enum pcie_bus_config_types pcie_bus_config;
extern struct bus_type pci_bus_type; extern const struct bus_type pci_bus_type;
/* Do NOT directly access these two variables, unless you are arch-specific PCI /* Do NOT directly access these two variables, unless you are arch-specific PCI
* code, or PCI core code. */ * code, or PCI core code. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment