Skip to content

Commit c309dbb

Browse files
Myron Stowebjorn-helgaas
authored andcommitted
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>
1 parent 3d54a31 commit c309dbb

2 files changed

Lines changed: 1 addition & 56 deletions

File tree

‎drivers/acpi/pci_root.c‎

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -65,44 +65,12 @@ static struct acpi_scan_handler pci_root_handler = {
6565
.detach = acpi_pci_root_remove,
6666
};
6767

68-
/* Lock to protect both acpi_pci_roots and acpi_pci_drivers lists */
68+
/* Lock to protect both acpi_pci_roots lists */
6969
static DEFINE_MUTEX(acpi_pci_root_lock);
7070
static LIST_HEAD(acpi_pci_roots);
71-
static LIST_HEAD(acpi_pci_drivers);
7271

7372
static DEFINE_MUTEX(osc_lock);
7473

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-
10674
/**
10775
* acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
10876
* @handle - the ACPI CA node in question.
@@ -413,7 +381,6 @@ static int acpi_pci_root_add(struct acpi_device *device,
413381
acpi_status status;
414382
int result;
415383
struct acpi_pci_root *root;
416-
struct acpi_pci_driver *driver;
417384
u32 flags, base_flags;
418385
bool is_osc_granted = false;
419386

@@ -573,12 +540,6 @@ static int acpi_pci_root_add(struct acpi_device *device,
573540
pci_assign_unassigned_bus_resources(root->bus);
574541
}
575542

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-
582543
/* need to after hot-added ioapic is registered */
583544
if (system_state != SYSTEM_BOOTING)
584545
pci_enable_bridges(root->bus);
@@ -599,16 +560,9 @@ static int acpi_pci_root_add(struct acpi_device *device,
599560
static void acpi_pci_root_remove(struct acpi_device *device)
600561
{
601562
struct acpi_pci_root *root = acpi_driver_data(device);
602-
struct acpi_pci_driver *driver;
603563

604564
pci_stop_root_bus(root->bus);
605565

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-
612566
device_set_run_wake(root->bus->bridge, false);
613567
pci_acpi_remove_bus_pm_notifier(device);
614568

‎include/linux/acpi.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,6 @@ void acpi_penalize_isa_irq(int irq, int active);
152152

153153
void acpi_pci_irq_disable (struct pci_dev *dev);
154154

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-
164155
extern int ec_read(u8 addr, u8 *val);
165156
extern int ec_write(u8 addr, u8 val);
166157
extern int ec_transaction(u8 command,

0 commit comments

Comments
 (0)