diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/pci_root.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 4fb747205418..e95b5ac2e609 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -63,9 +63,10 @@ static struct acpi_driver acpi_pci_root_driver = { | |||
63 | 63 | ||
64 | struct acpi_pci_root { | 64 | struct acpi_pci_root { |
65 | struct list_head node; | 65 | struct list_head node; |
66 | struct acpi_device * device; | 66 | struct acpi_device *device; |
67 | struct acpi_pci_id id; | ||
68 | struct pci_bus *bus; | 67 | struct pci_bus *bus; |
68 | u16 segment; | ||
69 | u8 bus_nr; | ||
69 | 70 | ||
70 | u32 osc_support_set; /* _OSC state of support bits */ | 71 | u32 osc_support_set; /* _OSC state of support bits */ |
71 | u32 osc_control_set; /* _OSC state of control bits */ | 72 | u32 osc_control_set; /* _OSC state of control bits */ |
@@ -129,7 +130,7 @@ acpi_handle acpi_get_pci_rootbridge_handle(unsigned int seg, unsigned int bus) | |||
129 | struct acpi_pci_root *root; | 130 | struct acpi_pci_root *root; |
130 | 131 | ||
131 | list_for_each_entry(root, &acpi_pci_roots, node) | 132 | list_for_each_entry(root, &acpi_pci_roots, node) |
132 | if ((root->id.segment == (u16) seg) && (root->id.bus == (u16) bus)) | 133 | if ((root->segment == (u16) seg) && (root->bus_nr == (u16) bus)) |
133 | return root->device->handle; | 134 | return root->device->handle; |
134 | return NULL; | 135 | return NULL; |
135 | } | 136 | } |
@@ -395,6 +396,8 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
395 | 396 | ||
396 | INIT_LIST_HEAD(&root->node); | 397 | INIT_LIST_HEAD(&root->node); |
397 | root->device = device; | 398 | root->device = device; |
399 | root->segment = segment & 0xFFFF; | ||
400 | root->bus_nr = bus & 0xFF; | ||
398 | strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); | 401 | strcpy(acpi_device_name(device), ACPI_PCI_ROOT_DEVICE_NAME); |
399 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); | 402 | strcpy(acpi_device_class(device), ACPI_PCI_ROOT_CLASS); |
400 | device->driver_data = root; | 403 | device->driver_data = root; |
@@ -409,16 +412,6 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
409 | acpi_pci_osc_support(root, flags); | 412 | acpi_pci_osc_support(root, flags); |
410 | 413 | ||
411 | /* | 414 | /* |
412 | * Device & Function | ||
413 | * ----------------- | ||
414 | * Obtained from _ADR (which has already been evaluated for us). | ||
415 | */ | ||
416 | root->id.segment = segment & 0xFFFF; | ||
417 | root->id.bus = bus & 0xFF; | ||
418 | root->id.device = device->pnp.bus_address >> 16; | ||
419 | root->id.function = device->pnp.bus_address & 0xFFFF; | ||
420 | |||
421 | /* | ||
422 | * TBD: Need PCI interface for enumeration/configuration of roots. | 415 | * TBD: Need PCI interface for enumeration/configuration of roots. |
423 | */ | 416 | */ |
424 | 417 | ||
@@ -427,7 +420,7 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
427 | 420 | ||
428 | printk(KERN_INFO PREFIX "%s [%s] (%04x:%02x)\n", | 421 | printk(KERN_INFO PREFIX "%s [%s] (%04x:%02x)\n", |
429 | acpi_device_name(device), acpi_device_bid(device), | 422 | acpi_device_name(device), acpi_device_bid(device), |
430 | root->id.segment, root->id.bus); | 423 | root->segment, root->bus_nr); |
431 | 424 | ||
432 | /* | 425 | /* |
433 | * Scan the Root Bridge | 426 | * Scan the Root Bridge |
@@ -436,11 +429,11 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
436 | * PCI namespace does not get created until this call is made (and | 429 | * PCI namespace does not get created until this call is made (and |
437 | * thus the root bridge's pci_dev does not exist). | 430 | * thus the root bridge's pci_dev does not exist). |
438 | */ | 431 | */ |
439 | root->bus = pci_acpi_scan_root(device, root->id.segment, root->id.bus); | 432 | root->bus = pci_acpi_scan_root(device, segment, bus); |
440 | if (!root->bus) { | 433 | if (!root->bus) { |
441 | printk(KERN_ERR PREFIX | 434 | printk(KERN_ERR PREFIX |
442 | "Bus %04x:%02x not present in PCI namespace\n", | 435 | "Bus %04x:%02x not present in PCI namespace\n", |
443 | root->id.segment, root->id.bus); | 436 | root->segment, root->bus_nr); |
444 | result = -ENODEV; | 437 | result = -ENODEV; |
445 | goto end; | 438 | goto end; |
446 | } | 439 | } |