mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 21:44:06 +08:00
PCI/PM: Call .bridge_d3() hook only if non-NULL
26ad34d510
("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") added the struct pci_platform_pm_ops.bridge_d3() function pointer and platform_pci_bridge_d3() to use it. The .bridge_d3() op is implemented by acpi_pci_platform_pm, but not by mid_pci_platform_pm. We don't expect platform_pci_bridge_d3() to be called on Intel MID platforms, but nothing in the code itself would prevent that. Check the .bridge_d3() pointer for NULL before calling it. Fixes:26ad34d510
("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
This commit is contained in:
parent
8f3d9f3542
commit
c3aaf08670
@ -868,7 +868,9 @@ static inline bool platform_pci_need_resume(struct pci_dev *dev)
|
||||
|
||||
static inline bool platform_pci_bridge_d3(struct pci_dev *dev)
|
||||
{
|
||||
return pci_platform_pm ? pci_platform_pm->bridge_d3(dev) : false;
|
||||
if (pci_platform_pm && pci_platform_pm->bridge_d3)
|
||||
return pci_platform_pm->bridge_d3(dev);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user