Merge branch 'acpi-hotplug'
* acpi-hotplug: ACPI / scan: ACPI device object sysfs attribute for _STA evaluation ACPI / hotplug / driver core: Handle containers in a special way ACPI / hotplug: Add demand_offline hotplug profile flag ACPI / bind: Move acpi_get_child() to drivers/ide/ide-acpi.c ACPI / bind: Pass struct acpi_device pointer to acpi_bind_one() ACPI / bind: Rework struct acpi_bus_type ACPI / bind: Redefine acpi_preset_companion() ACPI / bind: Redefine acpi_get_child() PCI / ACPI: Use acpi_find_child_device() for child devices lookup ACPI / bind: Simplify child device lookups ACPI / scan: Use direct recurrence for device hierarchy walks ACPI: Introduce acpi_set_device_status() ACPI / hotplug: Drop unfinished global notification handling routines ACPI / hotplug: Rework generic code to handle suprise removals ACPI / hotplug: Move container-specific code out of the core ACPI / hotplug: Make ACPI PCI root hotplug use common hotplug code ACPI / hotplug: Introduce common hotplug function acpi_device_hotplug() ACPI / hotplug: Do not fail bus and device checks for disabled hotplug ACPI / scan: Add acpi_device objects for all device nodes in the namespace ACPI / scan: Define non-empty device removal handler
This commit is contained in:
@@ -303,10 +303,10 @@ void acpi_pci_remove_bus(struct pci_bus *bus)
|
||||
}
|
||||
|
||||
/* ACPI bus type */
|
||||
static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
|
||||
static struct acpi_device *acpi_pci_find_companion(struct device *dev)
|
||||
{
|
||||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
bool is_bridge;
|
||||
bool check_children;
|
||||
u64 addr;
|
||||
|
||||
/*
|
||||
@@ -314,14 +314,12 @@ static int acpi_pci_find_device(struct device *dev, acpi_handle *handle)
|
||||
* is set only after acpi_pci_find_device() has been called for the
|
||||
* given device.
|
||||
*/
|
||||
is_bridge = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
|
||||
check_children = pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE
|
||||
|| pci_dev->hdr_type == PCI_HEADER_TYPE_CARDBUS;
|
||||
/* Please ref to ACPI spec for the syntax of _ADR */
|
||||
addr = (PCI_SLOT(pci_dev->devfn) << 16) | PCI_FUNC(pci_dev->devfn);
|
||||
*handle = acpi_find_child(ACPI_HANDLE(dev->parent), addr, is_bridge);
|
||||
if (!*handle)
|
||||
return -ENODEV;
|
||||
return 0;
|
||||
return acpi_find_child_device(ACPI_COMPANION(dev->parent), addr,
|
||||
check_children);
|
||||
}
|
||||
|
||||
static void pci_acpi_setup(struct device *dev)
|
||||
@@ -364,7 +362,7 @@ static bool pci_acpi_bus_match(struct device *dev)
|
||||
static struct acpi_bus_type acpi_pci_bus = {
|
||||
.name = "PCI",
|
||||
.match = pci_acpi_bus_match,
|
||||
.find_device = acpi_pci_find_device,
|
||||
.find_companion = acpi_pci_find_companion,
|
||||
.setup = pci_acpi_setup,
|
||||
.cleanup = pci_acpi_cleanup,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user