From 5bcc2fb4e8157d829a38093b98e23329ac8acff7 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 8 Sep 2009 23:12:59 +0200 Subject: PCI PM: Simplify PCI wake-up code Rework the PCI wake-up code so that it's easier to read without changing the functionality. Reviewed-by: Matthew Garrett Signed-off-by: Rafael J. Wysocki Signed-off-by: Jesse Barnes --- drivers/pci/pci-acpi.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/pci/pci-acpi.c') diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index ea15b053745..e798c4736a6 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -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; } -- cgit v1.2.3