aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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