summaryrefslogtreecommitdiff
path: root/drivers/pci/pci-acpi.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2009-09-09 01:12:59 +0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-10 01:19:00 +0400
commit5bcc2fb4e8157d829a38093b98e23329ac8acff7 (patch)
tree458960ac494d1427ec96cbbfcaa68bd7c0e0b778 /drivers/pci/pci-acpi.c
parent748df9a4c65625c386674c9b54dde73de6cc5af5 (diff)
downloadlinux-5bcc2fb4e8157d829a38093b98e23329ac8acff7.tar.xz
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 <mjg59@srcf.ucam.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r--drivers/pci/pci-acpi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index ea15b0537457..e798c4736a66 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;
}