aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/pci_root.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/pci_root.c')
-rw-r--r--drivers/acpi/pci_root.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 4c313eab6313..8f10442119f0 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -160,14 +160,13 @@ static int acpi_pci_root_add(struct acpi_device *device)
160 unsigned long value = 0; 160 unsigned long value = 0;
161 acpi_handle handle = NULL; 161 acpi_handle handle = NULL;
162 162
163 ACPI_FUNCTION_TRACE("acpi_pci_root_add");
164 163
165 if (!device) 164 if (!device)
166 return_VALUE(-EINVAL); 165 return -EINVAL;
167 166
168 root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); 167 root = kmalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
169 if (!root) 168 if (!root)
170 return_VALUE(-ENOMEM); 169 return -ENOMEM;
171 memset(root, 0, sizeof(struct acpi_pci_root)); 170 memset(root, 0, sizeof(struct acpi_pci_root));
172 INIT_LIST_HEAD(&root->node); 171 INIT_LIST_HEAD(&root->node);
173 172
@@ -198,7 +197,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
198 root->id.segment = 0; 197 root->id.segment = 0;
199 break; 198 break;
200 default: 199 default:
201 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _SEG\n")); 200 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SEG"));
202 result = -ENODEV; 201 result = -ENODEV;
203 goto end; 202 goto end;
204 } 203 }
@@ -219,7 +218,7 @@ static int acpi_pci_root_add(struct acpi_device *device)
219 root->id.bus = 0; 218 root->id.bus = 0;
220 break; 219 break;
221 default: 220 default:
222 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error evaluating _BBN\n")); 221 ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BBN"));
223 result = -ENODEV; 222 result = -ENODEV;
224 goto end; 223 goto end;
225 } 224 }
@@ -231,8 +230,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
231 int bus = 0; 230 int bus = 0;
232 acpi_status status; 231 acpi_status status;
233 232
234 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 233 printk(KERN_ERR PREFIX
235 "Wrong _BBN value, please reboot and using option 'pci=noacpi'\n")); 234 "Wrong _BBN value, reboot"
235 " and use option 'pci=noacpi'\n");
236 236
237 status = try_get_root_bridge_busnr(root->handle, &bus); 237 status = try_get_root_bridge_busnr(root->handle, &bus);
238 if (ACPI_FAILURE(status)) 238 if (ACPI_FAILURE(status))
@@ -273,9 +273,9 @@ static int acpi_pci_root_add(struct acpi_device *device)
273 */ 273 */
274 root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus); 274 root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus);
275 if (!root->bus) { 275 if (!root->bus) {
276 ACPI_DEBUG_PRINT((ACPI_DB_ERROR, 276 printk(KERN_ERR PREFIX
277 "Bus %04x:%02x not present in PCI namespace\n", 277 "Bus %04x:%02x not present in PCI namespace\n",
278 root->id.segment, root->id.bus)); 278 root->id.segment, root->id.bus);
279 result = -ENODEV; 279 result = -ENODEV;
280 goto end; 280 goto end;
281 } 281 }
@@ -306,46 +306,43 @@ static int acpi_pci_root_add(struct acpi_device *device)
306 kfree(root); 306 kfree(root);
307 } 307 }
308 308
309 return_VALUE(result); 309 return result;
310} 310}
311 311
312static int acpi_pci_root_start(struct acpi_device *device) 312static int acpi_pci_root_start(struct acpi_device *device)
313{ 313{
314 struct acpi_pci_root *root; 314 struct acpi_pci_root *root;
315 315
316 ACPI_FUNCTION_TRACE("acpi_pci_root_start");
317 316
318 list_for_each_entry(root, &acpi_pci_roots, node) { 317 list_for_each_entry(root, &acpi_pci_roots, node) {
319 if (root->handle == device->handle) { 318 if (root->handle == device->handle) {
320 pci_bus_add_devices(root->bus); 319 pci_bus_add_devices(root->bus);
321 return_VALUE(0); 320 return 0;
322 } 321 }
323 } 322 }
324 return_VALUE(-ENODEV); 323 return -ENODEV;
325} 324}
326 325
327static int acpi_pci_root_remove(struct acpi_device *device, int type) 326static int acpi_pci_root_remove(struct acpi_device *device, int type)
328{ 327{
329 struct acpi_pci_root *root = NULL; 328 struct acpi_pci_root *root = NULL;
330 329
331 ACPI_FUNCTION_TRACE("acpi_pci_root_remove");
332 330
333 if (!device || !acpi_driver_data(device)) 331 if (!device || !acpi_driver_data(device))
334 return_VALUE(-EINVAL); 332 return -EINVAL;
335 333
336 root = (struct acpi_pci_root *)acpi_driver_data(device); 334 root = (struct acpi_pci_root *)acpi_driver_data(device);
337 335
338 kfree(root); 336 kfree(root);
339 337
340 return_VALUE(0); 338 return 0;
341} 339}
342 340
343static int __init acpi_pci_root_init(void) 341static int __init acpi_pci_root_init(void)
344{ 342{
345 ACPI_FUNCTION_TRACE("acpi_pci_root_init");
346 343
347 if (acpi_pci_disabled) 344 if (acpi_pci_disabled)
348 return_VALUE(0); 345 return 0;
349 346
350 /* DEBUG: 347 /* DEBUG:
351 acpi_dbg_layer = ACPI_PCI_COMPONENT; 348 acpi_dbg_layer = ACPI_PCI_COMPONENT;
@@ -353,9 +350,9 @@ static int __init acpi_pci_root_init(void)
353 */ 350 */
354 351
355 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) 352 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
356 return_VALUE(-ENODEV); 353 return -ENODEV;
357 354
358 return_VALUE(0); 355 return 0;
359} 356}
360 357
361subsys_initcall(acpi_pci_root_init); 358subsys_initcall(acpi_pci_root_init);