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.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 1930397e3c52..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
@@ -307,46 +306,43 @@ static int acpi_pci_root_add(struct acpi_device *device)
307 kfree(root); 306 kfree(root);
308 } 307 }
309 308
310 return_VALUE(result); 309 return result;
311} 310}
312 311
313static int acpi_pci_root_start(struct acpi_device *device) 312static int acpi_pci_root_start(struct acpi_device *device)
314{ 313{
315 struct acpi_pci_root *root; 314 struct acpi_pci_root *root;
316 315
317 ACPI_FUNCTION_TRACE("acpi_pci_root_start");
318 316
319 list_for_each_entry(root, &acpi_pci_roots, node) { 317 list_for_each_entry(root, &acpi_pci_roots, node) {
320 if (root->handle == device->handle) { 318 if (root->handle == device->handle) {
321 pci_bus_add_devices(root->bus); 319 pci_bus_add_devices(root->bus);
322 return_VALUE(0); 320 return 0;
323 } 321 }
324 } 322 }
325 return_VALUE(-ENODEV); 323 return -ENODEV;
326} 324}
327 325
328static int acpi_pci_root_remove(struct acpi_device *device, int type) 326static int acpi_pci_root_remove(struct acpi_device *device, int type)
329{ 327{
330 struct acpi_pci_root *root = NULL; 328 struct acpi_pci_root *root = NULL;
331 329
332 ACPI_FUNCTION_TRACE("acpi_pci_root_remove");
333 330
334 if (!device || !acpi_driver_data(device)) 331 if (!device || !acpi_driver_data(device))
335 return_VALUE(-EINVAL); 332 return -EINVAL;
336 333
337 root = (struct acpi_pci_root *)acpi_driver_data(device); 334 root = (struct acpi_pci_root *)acpi_driver_data(device);
338 335
339 kfree(root); 336 kfree(root);
340 337
341 return_VALUE(0); 338 return 0;
342} 339}
343 340
344static int __init acpi_pci_root_init(void) 341static int __init acpi_pci_root_init(void)
345{ 342{
346 ACPI_FUNCTION_TRACE("acpi_pci_root_init");
347 343
348 if (acpi_pci_disabled) 344 if (acpi_pci_disabled)
349 return_VALUE(0); 345 return 0;
350 346
351 /* DEBUG: 347 /* DEBUG:
352 acpi_dbg_layer = ACPI_PCI_COMPONENT; 348 acpi_dbg_layer = ACPI_PCI_COMPONENT;
@@ -354,9 +350,9 @@ static int __init acpi_pci_root_init(void)
354 */ 350 */
355 351
356 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0) 352 if (acpi_bus_register_driver(&acpi_pci_root_driver) < 0)
357 return_VALUE(-ENODEV); 353 return -ENODEV;
358 354
359 return_VALUE(0); 355 return 0;
360} 356}
361 357
362subsys_initcall(acpi_pci_root_init); 358subsys_initcall(acpi_pci_root_init);