diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-10-30 02:24:06 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-11-05 17:54:22 -0500 |
commit | 79c4412298771b8996302806abc8a11e760da9b3 (patch) | |
tree | c2c43b5ddc39a749ec4d48cff023c3d20eb78c28 /drivers/acpi/pci_irq.c | |
parent | f426cef3bc58806284e0fee55d29262b10279f9c (diff) |
ACPI: Pass segment/bus to _PRT add/del so they don't depend on pci_bus
This effectively reverts 859a3f86ca8 ("ACPI: simplify
acpi_pci_irq_add_prt() API") and d9efae3688a ("ACPI: simplify
acpi_pci_irq_del_prt() API").
The reason is to disentangle these routines from the struct pci_bus.
We want to be able to add the _PRT before the struct pci_bus
exists, and delete the _PRT after we've removed the pci_bus.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Diffstat (limited to 'drivers/acpi/pci_irq.c')
-rw-r--r-- | drivers/acpi/pci_irq.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 0eefa12e648c..8835cc38aa30 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -184,7 +184,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry, | |||
184 | } | 184 | } |
185 | } | 185 | } |
186 | 186 | ||
187 | static int acpi_pci_irq_add_entry(acpi_handle handle, struct pci_bus *bus, | 187 | static int acpi_pci_irq_add_entry(acpi_handle handle, int segment, int bus, |
188 | struct acpi_pci_routing_table *prt) | 188 | struct acpi_pci_routing_table *prt) |
189 | { | 189 | { |
190 | struct acpi_prt_entry *entry; | 190 | struct acpi_prt_entry *entry; |
@@ -198,8 +198,8 @@ static int acpi_pci_irq_add_entry(acpi_handle handle, struct pci_bus *bus, | |||
198 | * 1=INTA, 2=INTB. We use the PCI encoding throughout, so convert | 198 | * 1=INTA, 2=INTB. We use the PCI encoding throughout, so convert |
199 | * it here. | 199 | * it here. |
200 | */ | 200 | */ |
201 | entry->id.segment = pci_domain_nr(bus); | 201 | entry->id.segment = segment; |
202 | entry->id.bus = bus->number; | 202 | entry->id.bus = bus; |
203 | entry->id.device = (prt->address >> 16) & 0xFFFF; | 203 | entry->id.device = (prt->address >> 16) & 0xFFFF; |
204 | entry->pin = prt->pin + 1; | 204 | entry->pin = prt->pin + 1; |
205 | 205 | ||
@@ -244,7 +244,7 @@ static int acpi_pci_irq_add_entry(acpi_handle handle, struct pci_bus *bus, | |||
244 | return 0; | 244 | return 0; |
245 | } | 245 | } |
246 | 246 | ||
247 | int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus) | 247 | int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus) |
248 | { | 248 | { |
249 | acpi_status status; | 249 | acpi_status status; |
250 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 250 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |
@@ -273,7 +273,7 @@ int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus) | |||
273 | 273 | ||
274 | entry = buffer.pointer; | 274 | entry = buffer.pointer; |
275 | while (entry && (entry->length > 0)) { | 275 | while (entry && (entry->length > 0)) { |
276 | acpi_pci_irq_add_entry(handle, bus, entry); | 276 | acpi_pci_irq_add_entry(handle, segment, bus, entry); |
277 | entry = (struct acpi_pci_routing_table *) | 277 | entry = (struct acpi_pci_routing_table *) |
278 | ((unsigned long)entry + entry->length); | 278 | ((unsigned long)entry + entry->length); |
279 | } | 279 | } |
@@ -282,17 +282,16 @@ int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus) | |||
282 | return 0; | 282 | return 0; |
283 | } | 283 | } |
284 | 284 | ||
285 | void acpi_pci_irq_del_prt(struct pci_bus *bus) | 285 | void acpi_pci_irq_del_prt(int segment, int bus) |
286 | { | 286 | { |
287 | struct acpi_prt_entry *entry, *tmp; | 287 | struct acpi_prt_entry *entry, *tmp; |
288 | 288 | ||
289 | printk(KERN_DEBUG | 289 | printk(KERN_DEBUG |
290 | "ACPI: Delete PCI Interrupt Routing Table for %04x:%02x\n", | 290 | "ACPI: Delete PCI Interrupt Routing Table for %04x:%02x\n", |
291 | pci_domain_nr(bus), bus->number); | 291 | segment, bus); |
292 | spin_lock(&acpi_prt_lock); | 292 | spin_lock(&acpi_prt_lock); |
293 | list_for_each_entry_safe(entry, tmp, &acpi_prt_list, list) { | 293 | list_for_each_entry_safe(entry, tmp, &acpi_prt_list, list) { |
294 | if (pci_domain_nr(bus) == entry->id.segment | 294 | if (segment == entry->id.segment && bus == entry->id.bus) { |
295 | && bus->number == entry->id.bus) { | ||
296 | list_del(&entry->list); | 295 | list_del(&entry->list); |
297 | kfree(entry); | 296 | kfree(entry); |
298 | } | 297 | } |