mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
PCI: Use acpi_pci_power_manageable()
Use acpi_pci_power_manageable() instead of duplicating the logic in acpi_pci_bridge_d3(). No functional change intended. [bhelgaas: split out from https://lore.kernel.org/r/20210817180500.1253-8-ameynarkhede03@gmail.com] Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
3a15955d7c
commit
4273e64cc4
1 changed files with 10 additions and 8 deletions
|
@ -941,6 +941,15 @@ void pci_set_acpi_fwnode(struct pci_dev *dev)
|
||||||
acpi_pci_find_companion(&dev->dev));
|
acpi_pci_find_companion(&dev->dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool acpi_pci_power_manageable(struct pci_dev *dev)
|
||||||
|
{
|
||||||
|
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
||||||
|
|
||||||
|
if (!adev)
|
||||||
|
return false;
|
||||||
|
return acpi_device_power_manageable(adev);
|
||||||
|
}
|
||||||
|
|
||||||
static bool acpi_pci_bridge_d3(struct pci_dev *dev)
|
static bool acpi_pci_bridge_d3(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
const struct fwnode_handle *fwnode;
|
const struct fwnode_handle *fwnode;
|
||||||
|
@ -953,9 +962,8 @@ static bool acpi_pci_bridge_d3(struct pci_dev *dev)
|
||||||
|
|
||||||
/* Assume D3 support if the bridge is power-manageable by ACPI. */
|
/* Assume D3 support if the bridge is power-manageable by ACPI. */
|
||||||
pci_set_acpi_fwnode(dev);
|
pci_set_acpi_fwnode(dev);
|
||||||
adev = ACPI_COMPANION(&dev->dev);
|
|
||||||
|
|
||||||
if (adev && acpi_device_power_manageable(adev))
|
if (acpi_pci_power_manageable(dev))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -986,12 +994,6 @@ static bool acpi_pci_bridge_d3(struct pci_dev *dev)
|
||||||
return val == 1;
|
return val == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool acpi_pci_power_manageable(struct pci_dev *dev)
|
|
||||||
{
|
|
||||||
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
|
||||||
return adev ? acpi_device_power_manageable(adev) : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
|
static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
|
||||||
{
|
{
|
||||||
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue