ACPI: Pass segment/bus to _PRT add/del so they don't depend on pci_bus

This effectively reverts 859a3f86ca ("ACPI: simplify
acpi_pci_irq_add_prt() API") and d9efae3688 ("ACPI: simplify
acpi_pci_irq_del_prt() API").

The reason is to disentangle these routines from the struct pci_bus.
We want to be able to add the _PRT before the struct pci_bus
exists, and delete the _PRT after we've removed the pci_bus.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Esse commit está contido em:
Bjorn Helgaas
2012-10-30 15:24:06 +09:00
commit 79c4412298
4 arquivos alterados com 18 adições e 18 exclusões

Ver arquivo

@@ -49,7 +49,7 @@ static int acpi_pci_unbind(struct acpi_device *device)
if (!dev->subordinate)
goto out;
acpi_pci_irq_del_prt(dev->subordinate);
acpi_pci_irq_del_prt(pci_domain_nr(dev->bus), dev->subordinate->number);
device->ops.bind = NULL;
device->ops.unbind = NULL;
@@ -63,7 +63,7 @@ static int acpi_pci_bind(struct acpi_device *device)
{
acpi_status status;
acpi_handle handle;
struct pci_bus *bus;
unsigned char bus;
struct pci_dev *dev;
dev = acpi_get_pci_dev(device->handle);
@@ -100,11 +100,11 @@ static int acpi_pci_bind(struct acpi_device *device)
goto out;
if (dev->subordinate)
bus = dev->subordinate;
bus = dev->subordinate->number;
else
bus = dev->bus;
bus = dev->bus->number;
acpi_pci_irq_add_prt(device->handle, bus);
acpi_pci_irq_add_prt(device->handle, pci_domain_nr(dev->bus), bus);
out:
pci_dev_put(dev);