aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_irq.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2008-12-08 23:31:27 -0500
committerLen Brown <len.brown@intel.com>2008-12-30 21:44:52 -0500
commit4eaf6db3ea0edf7e011a613b5a15360444e58fec (patch)
tree05e10e074d677f6707c2e5d47003fc9bb42d97a1 /drivers/acpi/pci_irq.c
parent3604a9f445afde2801b8c24b63dd289c33e290a6 (diff)
ACPI: PCI: simplify struct acpi_prt_entry
Remove unused "irq" field, remove unnecessary struct, rename "handle" to "link". Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/pci_irq.c')
-rw-r--r--drivers/acpi/pci_irq.c35
1 files changed, 15 insertions, 20 deletions
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 42b195ed7922..643c4e864298 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -45,11 +45,8 @@ struct acpi_prt_entry {
45 struct list_head list; 45 struct list_head list;
46 struct acpi_pci_id id; 46 struct acpi_pci_id id;
47 u8 pin; 47 u8 pin;
48 struct { 48 acpi_handle link;
49 acpi_handle handle; 49 u32 index; /* GSI, or link _CRS index */
50 u32 index;
51 } link;
52 u32 irq;
53}; 50};
54 51
55static LIST_HEAD(acpi_prt_list); 52static LIST_HEAD(acpi_prt_list);
@@ -205,6 +202,8 @@ acpi_pci_irq_add_entry(acpi_handle handle,
205 202
206 do_prt_fixups(entry, prt); 203 do_prt_fixups(entry, prt);
207 204
205 entry->index = prt->source_index;
206
208 /* 207 /*
209 * Type 1: Dynamic 208 * Type 1: Dynamic
210 * --------------- 209 * ---------------
@@ -218,10 +217,9 @@ acpi_pci_irq_add_entry(acpi_handle handle,
218 * (e.g. exists somewhere 'below' this _PRT entry in the ACPI 217 * (e.g. exists somewhere 'below' this _PRT entry in the ACPI
219 * namespace). 218 * namespace).
220 */ 219 */
221 if (prt->source[0]) { 220 if (prt->source[0])
222 acpi_get_handle(handle, prt->source, &entry->link.handle); 221 acpi_get_handle(handle, prt->source, &entry->link);
223 entry->link.index = prt->source_index; 222
224 }
225 /* 223 /*
226 * Type 2: Static 224 * Type 2: Static
227 * -------------- 225 * --------------
@@ -229,14 +227,12 @@ acpi_pci_irq_add_entry(acpi_handle handle,
229 * the IRQ value, which is hardwired to specific interrupt inputs on 227 * the IRQ value, which is hardwired to specific interrupt inputs on
230 * the interrupt controller. 228 * the interrupt controller.
231 */ 229 */
232 else
233 entry->link.index = prt->source_index;
234 230
235 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO, 231 ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO,
236 " %04x:%02x:%02x[%c] -> %s[%d]\n", 232 " %04x:%02x:%02x[%c] -> %s[%d]\n",
237 entry->id.segment, entry->id.bus, 233 entry->id.segment, entry->id.bus,
238 entry->id.device, pin_name(entry->pin), 234 entry->id.device, pin_name(entry->pin),
239 prt->source, entry->link.index)); 235 prt->source, entry->index));
240 236
241 spin_lock(&acpi_prt_lock); 237 spin_lock(&acpi_prt_lock);
242 list_add_tail(&entry->list, &acpi_prt_list); 238 list_add_tail(&entry->list, &acpi_prt_list);
@@ -310,17 +306,16 @@ acpi_pci_allocate_irq(struct acpi_prt_entry *entry,
310 int irq; 306 int irq;
311 307
312 308
313 if (entry->link.handle) { 309 if (entry->link) {
314 irq = acpi_pci_link_allocate_irq(entry->link.handle, 310 irq = acpi_pci_link_allocate_irq(entry->link, entry->index,
315 entry->link.index, triggering, 311 triggering, polarity, link);
316 polarity, link);
317 if (irq < 0) { 312 if (irq < 0) {
318 printk(KERN_WARNING PREFIX 313 printk(KERN_WARNING PREFIX
319 "Invalid IRQ link routing entry\n"); 314 "Invalid IRQ link routing entry\n");
320 return -1; 315 return -1;
321 } 316 }
322 } else { 317 } else {
323 irq = entry->link.index; 318 irq = entry->index;
324 *triggering = ACPI_LEVEL_SENSITIVE; 319 *triggering = ACPI_LEVEL_SENSITIVE;
325 *polarity = ACPI_ACTIVE_LOW; 320 *polarity = ACPI_ACTIVE_LOW;
326 } 321 }
@@ -334,10 +329,10 @@ acpi_pci_free_irq(struct acpi_prt_entry *entry)
334{ 329{
335 int irq; 330 int irq;
336 331
337 if (entry->link.handle) { 332 if (entry->link) {
338 irq = acpi_pci_link_free_irq(entry->link.handle); 333 irq = acpi_pci_link_free_irq(entry->link);
339 } else { 334 } else {
340 irq = entry->link.index; 335 irq = entry->index;
341 } 336 }
342 return irq; 337 return irq;
343} 338}