mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 17:41:44 +00:00
ACPI: pci_root: use driver data rather than list lookup
There's no need to search the list to find the acpi_pci_root structure. We saved it as device->driver_data when we added the device. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
f5eebbe119
commit
caf420c68a
@ -497,30 +497,17 @@ end:
|
|||||||
|
|
||||||
static int acpi_pci_root_start(struct acpi_device *device)
|
static int acpi_pci_root_start(struct acpi_device *device)
|
||||||
{
|
{
|
||||||
struct acpi_pci_root *root;
|
struct acpi_pci_root *root = acpi_driver_data(device);
|
||||||
|
|
||||||
|
pci_bus_add_devices(root->bus);
|
||||||
list_for_each_entry(root, &acpi_pci_roots, node) {
|
return 0;
|
||||||
if (root->device == device) {
|
|
||||||
pci_bus_add_devices(root->bus);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int acpi_pci_root_remove(struct acpi_device *device, int type)
|
static int acpi_pci_root_remove(struct acpi_device *device, int type)
|
||||||
{
|
{
|
||||||
struct acpi_pci_root *root = NULL;
|
struct acpi_pci_root *root = acpi_driver_data(device);
|
||||||
|
|
||||||
|
|
||||||
if (!device || !acpi_driver_data(device))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
root = acpi_driver_data(device);
|
|
||||||
|
|
||||||
kfree(root);
|
kfree(root);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user