aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/internal.h2
-rw-r--r--drivers/acpi/pci_root.c38
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
26int init_acpi_device_notify(void); 26int init_acpi_device_notify(void);
27int acpi_scan_init(void); 27int acpi_scan_init(void);
28void acpi_pci_root_init(void);
28int acpi_sysfs_init(void); 29int acpi_sysfs_init(void);
29void acpi_csrt_init(void); 30void acpi_csrt_init(void);
30 31
@@ -86,7 +87,6 @@ struct acpi_ec {
86 87
87extern struct acpi_ec *first_ec; 88extern struct acpi_ec *first_ec;
88 89
89int acpi_pci_root_init(void);
90int acpi_ec_init(void); 90int acpi_ec_init(void);
91int acpi_ec_ecdt_probe(void); 91int acpi_ec_ecdt_probe(void);
92int acpi_boot_ec_enable(void); 92int 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 @@
45ACPI_MODULE_NAME("pci_root"); 45ACPI_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"
48static int acpi_pci_root_add(struct acpi_device *device); 48static int acpi_pci_root_add(struct acpi_device *device,
49static int acpi_pci_root_remove(struct acpi_device *device); 49 const struct acpi_device_id *not_used);
50static 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};
60MODULE_DEVICE_TABLE(acpi, root_device_ids);
61 61
62static struct acpi_driver acpi_pci_root_driver = { 62static 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}
429EXPORT_SYMBOL(acpi_pci_osc_control_set); 425EXPORT_SYMBOL(acpi_pci_osc_control_set);
430 426
431static int acpi_pci_root_add(struct acpi_device *device) 427static 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
619out_del_root: 616out_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
630static int acpi_pci_root_remove(struct acpi_device *device) 627static 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
661int __init acpi_pci_root_init(void) 657void __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}