提交 caf420c6 编写于 作者: B Bjorn Helgaas 提交者: Len Brown

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: NBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 f5eebbe1
......@@ -497,30 +497,17 @@ static int __devinit acpi_pci_root_add(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);
list_for_each_entry(root, &acpi_pci_roots, node) {
if (root->device == device) {
pci_bus_add_devices(root->bus);
return 0;
}
}
return -ENODEV;
pci_bus_add_devices(root->bus);
return 0;
}
static int acpi_pci_root_remove(struct acpi_device *device, int type)
{
struct acpi_pci_root *root = NULL;
if (!device || !acpi_driver_data(device))
return -EINVAL;
root = acpi_driver_data(device);
struct acpi_pci_root *root = acpi_driver_data(device);
kfree(root);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册