aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-28 21:14:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-28 21:14:24 -0400
commit1d9b9f6a53d77ed801ba875f937d6dabbfc381ce (patch)
tree36ea93b80a444c3b37111e352790ebc07f29379f /drivers/acpi
parenta3ad7f128c637b7612ebeacb1f85fec933bb1195 (diff)
parent12c0b20fa4afb5c8a377d6987fb2dcf353e1dce1 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (21 commits) x86/PCI: use dev_printk when possible PCI: add D3 power state avoidance quirk PCI: fix bogus "'device' may be used uninitialized" warning in pci_slot PCI: add an option to allow ASPM enabled forcibly PCI: disable ASPM on pre-1.1 PCIe devices PCI: disable ASPM per ACPI FADT setting PCI MSI: Don't disable MSIs if the mask bit isn't supported PCI: handle 64-bit resources better on 32-bit machines PCI: rewrite PCI BAR reading code PCI: document pci_target_state PCI hotplug: fix typo in pcie hotplug output x86 gart: replace to_pages macro with iommu_num_pages x86, AMD IOMMU: replace to_pages macro with iommu_num_pages iommu: add iommu_num_pages helper function dma-coherent: add documentation to new interfaces Cris: convert to using generic dma-coherent mem allocator Sh: use generic per-device coherent dma allocator ARM: support generic per-device coherent dma mem Generic dma-coherent: fix DMA_MEMORY_EXCLUSIVE x86: use generic per-device dma coherent allocator ...
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/pci_slot.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index dd376f7ad090..d5b4ef898879 100644
--- a/drivers/acpi/pci_slot.c
+++ b/drivers/acpi/pci_slot.c
@@ -76,9 +76,9 @@ static struct acpi_pci_driver acpi_pci_slot_driver = {
76}; 76};
77 77
78static int 78static int
79check_slot(acpi_handle handle, int *device, unsigned long *sun) 79check_slot(acpi_handle handle, unsigned long *sun)
80{ 80{
81 int retval = 0; 81 int device = -1;
82 unsigned long adr, sta; 82 unsigned long adr, sta;
83 acpi_status status; 83 acpi_status status;
84 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 84 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
@@ -89,32 +89,27 @@ check_slot(acpi_handle handle, int *device, unsigned long *sun)
89 if (check_sta_before_sun) { 89 if (check_sta_before_sun) {
90 /* If SxFy doesn't have _STA, we just assume it's there */ 90 /* If SxFy doesn't have _STA, we just assume it's there */
91 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 91 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
92 if (ACPI_SUCCESS(status) && !(sta & ACPI_STA_DEVICE_PRESENT)) { 92 if (ACPI_SUCCESS(status) && !(sta & ACPI_STA_DEVICE_PRESENT))
93 retval = -1;
94 goto out; 93 goto out;
95 }
96 } 94 }
97 95
98 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); 96 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr);
99 if (ACPI_FAILURE(status)) { 97 if (ACPI_FAILURE(status)) {
100 dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer); 98 dbg("_ADR returned %d on %s\n", status, (char *)buffer.pointer);
101 retval = -1;
102 goto out; 99 goto out;
103 } 100 }
104 101
105 *device = (adr >> 16) & 0xffff;
106
107 /* No _SUN == not a slot == bail */ 102 /* No _SUN == not a slot == bail */
108 status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); 103 status = acpi_evaluate_integer(handle, "_SUN", NULL, sun);
109 if (ACPI_FAILURE(status)) { 104 if (ACPI_FAILURE(status)) {
110 dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer); 105 dbg("_SUN returned %d on %s\n", status, (char *)buffer.pointer);
111 retval = -1;
112 goto out; 106 goto out;
113 } 107 }
114 108
109 device = (adr >> 16) & 0xffff;
115out: 110out:
116 kfree(buffer.pointer); 111 kfree(buffer.pointer);
117 return retval; 112 return device;
118} 113}
119 114
120struct callback_args { 115struct callback_args {
@@ -144,7 +139,8 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
144 struct callback_args *parent_context = context; 139 struct callback_args *parent_context = context;
145 struct pci_bus *pci_bus = parent_context->pci_bus; 140 struct pci_bus *pci_bus = parent_context->pci_bus;
146 141
147 if (check_slot(handle, &device, &sun)) 142 device = check_slot(handle, &sun);
143 if (device < 0)
148 return AE_OK; 144 return AE_OK;
149 145
150 slot = kmalloc(sizeof(*slot), GFP_KERNEL); 146 slot = kmalloc(sizeof(*slot), GFP_KERNEL);