]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/pci/pci-acpi.c
PCI PM: Simplify PCI wake-up code
[net-next-2.6.git] / drivers / pci / pci-acpi.c
index ea15b05374570e03a6fd4068b5caa56185dff202..e798c4736a66a7e3a65acb56dc53ec3b6c073489 100644 (file)
@@ -111,12 +111,16 @@ static bool acpi_pci_can_wakeup(struct pci_dev *dev)
 
 static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable)
 {
-       int error = acpi_pm_device_sleep_wake(&dev->dev, enable);
+       int error;
 
+       if (!acpi_pci_can_wakeup(dev))
+               return 0;
+
+       error = acpi_pm_device_sleep_wake(&dev->dev, enable);
        if (!error)
-               dev_printk(KERN_INFO, &dev->dev,
-                               "wake-up capability %s by ACPI\n",
+               dev_info(&dev->dev, "wake-up capability %s by ACPI\n",
                                enable ? "enabled" : "disabled");
+
        return error;
 }