diff options
-rw-r--r-- | drivers/acpi/internal.h | 2 | ||||
-rw-r--r-- | drivers/acpi/pci_root.c | 38 |
2 files changed, 16 insertions, 24 deletions
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index da233477d260..8310ba010176 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | int init_acpi_device_notify(void); | 26 | int init_acpi_device_notify(void); |
27 | int acpi_scan_init(void); | 27 | int acpi_scan_init(void); |
28 | void acpi_pci_root_init(void); | ||
28 | int acpi_sysfs_init(void); | 29 | int acpi_sysfs_init(void); |
29 | void acpi_csrt_init(void); | 30 | void acpi_csrt_init(void); |
30 | 31 | ||
@@ -86,7 +87,6 @@ struct acpi_ec { | |||
86 | 87 | ||
87 | extern struct acpi_ec *first_ec; | 88 | extern struct acpi_ec *first_ec; |
88 | 89 | ||
89 | int acpi_pci_root_init(void); | ||
90 | int acpi_ec_init(void); | 90 | int acpi_ec_init(void); |
91 | int acpi_ec_ecdt_probe(void); | 91 | int acpi_ec_ecdt_probe(void); |
92 | int acpi_boot_ec_enable(void); | 92 | int acpi_boot_ec_enable(void); |
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 8890775e8b25..b3cc69c5caf1 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -45,8 +45,9 @@ | |||
45 | ACPI_MODULE_NAME("pci_root"); | 45 | ACPI_MODULE_NAME("pci_root"); |
46 | #define ACPI_PCI_ROOT_CLASS "pci_bridge" | 46 | #define ACPI_PCI_ROOT_CLASS "pci_bridge" |
47 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" | 47 | #define ACPI_PCI_ROOT_DEVICE_NAME "PCI Root Bridge" |
48 | static int acpi_pci_root_add(struct acpi_device *device); | 48 | static int acpi_pci_root_add(struct acpi_device *device, |
49 | static int acpi_pci_root_remove(struct acpi_device *device); | 49 | const struct acpi_device_id *not_used); |
50 | static void acpi_pci_root_remove(struct acpi_device *device); | ||
50 | 51 | ||
51 | #define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \ | 52 | #define ACPI_PCIE_REQ_SUPPORT (OSC_EXT_PCI_CONFIG_SUPPORT \ |
52 | | OSC_ACTIVE_STATE_PWR_SUPPORT \ | 53 | | OSC_ACTIVE_STATE_PWR_SUPPORT \ |
@@ -57,16 +58,11 @@ static const struct acpi_device_id root_device_ids[] = { | |||
57 | {"PNP0A03", 0}, | 58 | {"PNP0A03", 0}, |
58 | {"", 0}, | 59 | {"", 0}, |
59 | }; | 60 | }; |
60 | MODULE_DEVICE_TABLE(acpi, root_device_ids); | ||
61 | 61 | ||
62 | static struct acpi_driver acpi_pci_root_driver = { | 62 | static struct acpi_scan_handler pci_root_handler = { |
63 | .name = "pci_root", | ||
64 | .class = ACPI_PCI_ROOT_CLASS, | ||
65 | .ids = root_device_ids, | 63 | .ids = root_device_ids, |
66 | .ops = { | 64 | .attach = acpi_pci_root_add, |
67 | .add = acpi_pci_root_add, | 65 | .detach = acpi_pci_root_remove, |
68 | .remove = acpi_pci_root_remove, | ||
69 | }, | ||
70 | }; | 66 | }; |
71 | 67 | ||
72 | /* Lock to protect both acpi_pci_roots and acpi_pci_drivers lists */ | 68 | /* Lock to protect both acpi_pci_roots and acpi_pci_drivers lists */ |
@@ -428,7 +424,8 @@ out: | |||
428 | } | 424 | } |
429 | EXPORT_SYMBOL(acpi_pci_osc_control_set); | 425 | EXPORT_SYMBOL(acpi_pci_osc_control_set); |
430 | 426 | ||
431 | static int acpi_pci_root_add(struct acpi_device *device) | 427 | static int acpi_pci_root_add(struct acpi_device *device, |
428 | const struct acpi_device_id *not_used) | ||
432 | { | 429 | { |
433 | unsigned long long segment, bus; | 430 | unsigned long long segment, bus; |
434 | acpi_status status; | 431 | acpi_status status; |
@@ -614,7 +611,7 @@ static int acpi_pci_root_add(struct acpi_device *device) | |||
614 | pci_enable_bridges(root->bus); | 611 | pci_enable_bridges(root->bus); |
615 | 612 | ||
616 | pci_bus_add_devices(root->bus); | 613 | pci_bus_add_devices(root->bus); |
617 | return 0; | 614 | return 1; |
618 | 615 | ||
619 | out_del_root: | 616 | out_del_root: |
620 | mutex_lock(&acpi_pci_root_lock); | 617 | mutex_lock(&acpi_pci_root_lock); |
@@ -627,7 +624,7 @@ end: | |||
627 | return result; | 624 | return result; |
628 | } | 625 | } |
629 | 626 | ||
630 | static int acpi_pci_root_remove(struct acpi_device *device) | 627 | static void acpi_pci_root_remove(struct acpi_device *device) |
631 | { | 628 | { |
632 | acpi_status status; | 629 | acpi_status status; |
633 | acpi_handle handle; | 630 | acpi_handle handle; |
@@ -655,19 +652,14 @@ static int acpi_pci_root_remove(struct acpi_device *device) | |||
655 | list_del(&root->node); | 652 | list_del(&root->node); |
656 | mutex_unlock(&acpi_pci_root_lock); | 653 | mutex_unlock(&acpi_pci_root_lock); |
657 | kfree(root); | 654 | kfree(root); |
658 | return 0; | ||
659 | } | 655 | } |
660 | 656 | ||
661 | int __init acpi_pci_root_init(void) | 657 | void __init acpi_pci_root_init(void) |
662 | { | 658 | { |
663 | acpi_hest_init(); | 659 | acpi_hest_init(); |
664 | 660 | ||
665 | if (acpi_pci_disabled) | 661 | if (!acpi_pci_disabled) { |
666 | return 0; | 662 | pci_acpi_crs_quirks(); |
667 | 663 | acpi_scan_add_handler(&pci_root_handler); | |
668 | pci_acpi_crs_quirks(); | 664 | } |
669 | if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) | ||
670 | return -ENODEV; | ||
671 | |||
672 | return 0; | ||
673 | } | 665 | } |