Commit df8db91f authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Jesse Barnes

PCI / ACPI PM: Rework some debug messages

Move a debug message from acpi_pci_sleep_wake() to
acpi_pm_device_sleep_wake() and use the standard dev_*() macros
in there.
Reviewed-by: default avatarMatthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
parent 5bcc2fb4
...@@ -689,19 +689,25 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable) ...@@ -689,19 +689,25 @@ int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
{ {
acpi_handle handle; acpi_handle handle;
struct acpi_device *adev; struct acpi_device *adev;
int error;
if (!device_may_wakeup(dev)) if (!device_may_wakeup(dev))
return -EINVAL; return -EINVAL;
handle = DEVICE_ACPI_HANDLE(dev); handle = DEVICE_ACPI_HANDLE(dev);
if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) { if (!handle || ACPI_FAILURE(acpi_bus_get_device(handle, &adev))) {
printk(KERN_DEBUG "ACPI handle has no context!\n"); dev_dbg(dev, "ACPI handle has no context in %s!\n", __func__);
return -ENODEV; return -ENODEV;
} }
return enable ? error = enable ?
acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) : acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) :
acpi_disable_wakeup_device_power(adev); acpi_disable_wakeup_device_power(adev);
if (!error)
dev_info(dev, "wake-up capability %s by ACPI\n",
enable ? "enabled" : "disabled");
return error;
} }
#endif #endif
......
...@@ -111,17 +111,8 @@ static bool acpi_pci_can_wakeup(struct pci_dev *dev) ...@@ -111,17 +111,8 @@ static bool acpi_pci_can_wakeup(struct pci_dev *dev)
static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable) static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable)
{ {
int error; return acpi_pci_can_wakeup(dev) ?
acpi_pm_device_sleep_wake(&dev->dev, enable) : 0;
if (!acpi_pci_can_wakeup(dev))
return 0;
error = acpi_pm_device_sleep_wake(&dev->dev, enable);
if (!error)
dev_info(&dev->dev, "wake-up capability %s by ACPI\n",
enable ? "enabled" : "disabled");
return error;
} }
static struct pci_platform_pm_ops acpi_pci_platform_pm = { static struct pci_platform_pm_ops acpi_pci_platform_pm = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment