aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2009-06-18 16:46:57 -0400
committerLen Brown <len.brown@intel.com>2009-06-20 00:01:53 -0400
commitcaf420c68afe01acd7c458ce40b85b3db5330ff5 (patch)
tree28463c5028597e94ca6cae2af914468ff687a72d /drivers/acpi/pci_root.c
parentf5eebbe119a861b5e4f5c67c886eab0937c686ed (diff)
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>
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 0d69c0348c58..7984e00540fa 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -497,30 +497,17 @@ end:
497 497
498static int acpi_pci_root_start(struct acpi_device *device) 498static int acpi_pci_root_start(struct acpi_device *device)
499{ 499{
500 struct acpi_pci_root *root; 500 struct acpi_pci_root *root = acpi_driver_data(device);
501
502 501
503 list_for_each_entry(root, &acpi_pci_roots, node) { 502 pci_bus_add_devices(root->bus);
504 if (root->device == device) { 503 return 0;
505 pci_bus_add_devices(root->bus);
506 return 0;
507 }
508 }
509 return -ENODEV;
510} 504}
511 505
512static int acpi_pci_root_remove(struct acpi_device *device, int type) 506static int acpi_pci_root_remove(struct acpi_device *device, int type)
513{ 507{
514 struct acpi_pci_root *root = NULL; 508 struct acpi_pci_root *root = acpi_driver_data(device);
515
516
517 if (!device || !acpi_driver_data(device))
518 return -EINVAL;
519
520 root = acpi_driver_data(device);
521 509
522 kfree(root); 510 kfree(root);
523
524 return 0; 511 return 0;
525} 512}
526 513