diff options
author | Myron Stowe <myron.stowe@redhat.com> | 2013-04-12 01:44:30 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-16 12:27:15 -0400 |
commit | c309dbb4debb714566e4cf0d5d4e4023c3c4ff2f (patch) | |
tree | e893ab29a02ec6ca2db67ddd96158e3f19ef7fc4 | |
parent | 3d54a3160fb6ba877324ffffa5d301dec8038fd9 (diff) |
PCI/ACPI: Remove support of ACPI PCI subdrivers
Both sub-drivers of the "PCI Root Bridge ("pci_bridge")" driver, "acpiphp"
and "pci_slot", have been converted to hook directly into the PCI core.
With the conversions there are no remaining usages of the 'struct
acpi_pci_driver' list based infrastructure. This patch removes it.
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Toshi Kani <toshi.kani@hp.com>
-rw-r--r-- | drivers/acpi/pci_root.c | 48 | ||||
-rw-r--r-- | include/linux/acpi.h | 9 |
2 files changed, 1 insertions, 56 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 0ac546d5e53f..b80e06e0b2d9 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -65,44 +65,12 @@ static struct acpi_scan_handler pci_root_handler = { | |||
65 | .detach = acpi_pci_root_remove, | 65 | .detach = acpi_pci_root_remove, |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /* Lock to protect both acpi_pci_roots and acpi_pci_drivers lists */ | 68 | /* Lock to protect both acpi_pci_roots lists */ |
69 | static DEFINE_MUTEX(acpi_pci_root_lock); | 69 | static DEFINE_MUTEX(acpi_pci_root_lock); |
70 | static LIST_HEAD(acpi_pci_roots); | 70 | static LIST_HEAD(acpi_pci_roots); |
71 | static LIST_HEAD(acpi_pci_drivers); | ||
72 | 71 | ||
73 | static DEFINE_MUTEX(osc_lock); | 72 | static DEFINE_MUTEX(osc_lock); |
74 | 73 | ||
75 | int acpi_pci_register_driver(struct acpi_pci_driver *driver) | ||
76 | { | ||
77 | int n = 0; | ||
78 | struct acpi_pci_root *root; | ||
79 | |||
80 | mutex_lock(&acpi_pci_root_lock); | ||
81 | list_add_tail(&driver->node, &acpi_pci_drivers); | ||
82 | if (driver->add) | ||
83 | list_for_each_entry(root, &acpi_pci_roots, node) { | ||
84 | driver->add(root); | ||
85 | n++; | ||
86 | } | ||
87 | mutex_unlock(&acpi_pci_root_lock); | ||
88 | |||
89 | return n; | ||
90 | } | ||
91 | EXPORT_SYMBOL(acpi_pci_register_driver); | ||
92 | |||
93 | void acpi_pci_unregister_driver(struct acpi_pci_driver *driver) | ||
94 | { | ||
95 | struct acpi_pci_root *root; | ||
96 | |||
97 | mutex_lock(&acpi_pci_root_lock); | ||
98 | list_del(&driver->node); | ||
99 | if (driver->remove) | ||
100 | list_for_each_entry(root, &acpi_pci_roots, node) | ||
101 | driver->remove(root); | ||
102 | mutex_unlock(&acpi_pci_root_lock); | ||
103 | } | ||
104 | EXPORT_SYMBOL(acpi_pci_unregister_driver); | ||
105 | |||
106 | /** | 74 | /** |
107 | * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge | 75 | * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge |
108 | * @handle - the ACPI CA node in question. | 76 | * @handle - the ACPI CA node in question. |
@@ -413,7 +381,6 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
413 | acpi_status status; | 381 | acpi_status status; |
414 | int result; | 382 | int result; |
415 | struct acpi_pci_root *root; | 383 | struct acpi_pci_root *root; |
416 | struct acpi_pci_driver *driver; | ||
417 | u32 flags, base_flags; | 384 | u32 flags, base_flags; |
418 | bool is_osc_granted = false; | 385 | bool is_osc_granted = false; |
419 | 386 | ||
@@ -573,12 +540,6 @@ static int acpi_pci_root_add(struct acpi_device *device, | |||
573 | pci_assign_unassigned_bus_resources(root->bus); | 540 | pci_assign_unassigned_bus_resources(root->bus); |
574 | } | 541 | } |
575 | 542 | ||
576 | mutex_lock(&acpi_pci_root_lock); | ||
577 | list_for_each_entry(driver, &acpi_pci_drivers, node) | ||
578 | if (driver->add) | ||
579 | driver->add(root); | ||
580 | mutex_unlock(&acpi_pci_root_lock); | ||
581 | |||
582 | /* need to after hot-added ioapic is registered */ | 543 | /* need to after hot-added ioapic is registered */ |
583 | if (system_state != SYSTEM_BOOTING) | 544 | if (system_state != SYSTEM_BOOTING) |
584 | pci_enable_bridges(root->bus); | 545 | pci_enable_bridges(root->bus); |
@@ -599,16 +560,9 @@ end: | |||
599 | static void acpi_pci_root_remove(struct acpi_device *device) | 560 | static void acpi_pci_root_remove(struct acpi_device *device) |
600 | { | 561 | { |
601 | struct acpi_pci_root *root = acpi_driver_data(device); | 562 | struct acpi_pci_root *root = acpi_driver_data(device); |
602 | struct acpi_pci_driver *driver; | ||
603 | 563 | ||
604 | pci_stop_root_bus(root->bus); | 564 | pci_stop_root_bus(root->bus); |
605 | 565 | ||
606 | mutex_lock(&acpi_pci_root_lock); | ||
607 | list_for_each_entry_reverse(driver, &acpi_pci_drivers, node) | ||
608 | if (driver->remove) | ||
609 | driver->remove(root); | ||
610 | mutex_unlock(&acpi_pci_root_lock); | ||
611 | |||
612 | device_set_run_wake(root->bus->bridge, false); | 566 | device_set_run_wake(root->bus->bridge, false); |
613 | pci_acpi_remove_bus_pm_notifier(device); | 567 | pci_acpi_remove_bus_pm_notifier(device); |
614 | 568 | ||
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index bcbdd7484e58..03053aca5b32 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -152,15 +152,6 @@ void acpi_penalize_isa_irq(int irq, int active); | |||
152 | 152 | ||
153 | void acpi_pci_irq_disable (struct pci_dev *dev); | 153 | void acpi_pci_irq_disable (struct pci_dev *dev); |
154 | 154 | ||
155 | struct acpi_pci_driver { | ||
156 | struct list_head node; | ||
157 | int (*add)(struct acpi_pci_root *root); | ||
158 | void (*remove)(struct acpi_pci_root *root); | ||
159 | }; | ||
160 | |||
161 | int acpi_pci_register_driver(struct acpi_pci_driver *driver); | ||
162 | void acpi_pci_unregister_driver(struct acpi_pci_driver *driver); | ||
163 | |||
164 | extern int ec_read(u8 addr, u8 *val); | 155 | extern int ec_read(u8 addr, u8 *val); |
165 | extern int ec_write(u8 addr, u8 val); | 156 | extern int ec_write(u8 addr, u8 val); |
166 | extern int ec_transaction(u8 command, | 157 | extern int ec_transaction(u8 command, |