]> err.no Git - linux-2.6/commitdiff
ACPI: ignore _PSx method for hotplugable PCI devices
authorShaohua Li <shaohua.li@intel.com>
Fri, 20 Jul 2007 02:03:25 +0000 (10:03 +0800)
committerLen Brown <len.brown@intel.com>
Sun, 22 Jul 2007 08:18:45 +0000 (04:18 -0400)
If the ACPI device has _EJ0, ignore the device.
_PSx will set power for the slot,
and the hotplug driver will take care of _PSx.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/pci/pci-acpi.c

index 5e866b94bcabfed1408b98f63924d3743edd436e..67c63d1f15829453941f94f3283d0bef1da421f1 100644 (file)
@@ -271,6 +271,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
 static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 {
        acpi_handle handle = DEVICE_ACPI_HANDLE(&dev->dev);
+       acpi_handle tmp;
        static int state_conv[] = {
                [0] = 0,
                [1] = 1,
@@ -282,6 +283,9 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
 
        if (!handle)
                return -ENODEV;
+       /* If the ACPI device has _EJ0, ignore the device */
+       if (ACPI_SUCCESS(acpi_get_handle(handle, "_EJ0", &tmp)))
+               return 0;
        return acpi_bus_set_power(handle, acpi_state);
 }