From patchwork Thu Sep 3 22:04:31 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael Wysocki X-Patchwork-Id: 45439 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n83M7PH0016057 for ; Thu, 3 Sep 2009 22:07:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932370AbZICWGm (ORCPT ); Thu, 3 Sep 2009 18:06:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932406AbZICWGl (ORCPT ); Thu, 3 Sep 2009 18:06:41 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:39277 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932395AbZICWGi (ORCPT ); Thu, 3 Sep 2009 18:06:38 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by ogre.sisk.pl (Postfix) with ESMTP id E294E156186; Thu, 3 Sep 2009 21:05:10 +0200 (CEST) Received: from ogre.sisk.pl ([127.0.0.1]) by localhost (ogre.sisk.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00362-04; Thu, 3 Sep 2009 21:04:40 +0200 (CEST) Received: from tosh.localnet (220-bem-13.acn.waw.pl [82.210.184.220]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ogre.sisk.pl (Postfix) with ESMTP id 7599015620D; Thu, 3 Sep 2009 21:04:40 +0200 (CEST) From: "Rafael J. Wysocki" To: linux-pm@lists.linux-foundation.org Subject: [RFC][PATCH 2/4] PCI/ACPI PM: Rework some debug messages Date: Fri, 4 Sep 2009 00:04:31 +0200 User-Agent: KMail/1.12.0 (Linux/2.6.31-rc8-rjw; KDE/4.3.0; x86_64; ; ) Cc: ACPI Devel Maling List , Henrique de Moraes Holschuh , Jesse Barnes , Linux PCI References: <200908300041.14541.rjw@sisk.pl> <200909020041.57754.rjw@sisk.pl> <200909040002.02562.rjw@sisk.pl> In-Reply-To: <200909040002.02562.rjw@sisk.pl> MIME-Version: 1.0 Message-Id: <200909040004.31484.rjw@sisk.pl> X-Virus-Scanned: amavisd-new at ogre.sisk.pl using MkS_Vir for Linux Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org From: Rafael J. Wysocki Move a debug message from acpi_pci_sleep_wake() to acpi_pm_device_sleep_wake() and use the standard dev_*() macros in there. Signed-off-by: Rafael J. Wysocki --- drivers/acpi/sleep.c | 10 ++++++++-- drivers/pci/pci-acpi.c | 13 ++----------- 2 files changed, 10 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/acpi/sleep.c =================================================================== --- linux-2.6.orig/drivers/acpi/sleep.c +++ linux-2.6/drivers/acpi/sleep.c @@ -689,19 +689,25 @@ int acpi_pm_device_sleep_wake(struct dev { acpi_handle handle; struct acpi_device *adev; + int error; if (!device_may_wakeup(dev)) return -EINVAL; handle = DEVICE_ACPI_HANDLE(dev); 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 enable ? + error = enable ? acpi_enable_wakeup_device_power(adev, acpi_target_sleep_state) : acpi_disable_wakeup_device_power(adev); + if (!error) + dev_info(dev, "wake-up capability %s by ACPI\n", + enable ? "enabled" : "disabled"); + + return error; } #endif Index: linux-2.6/drivers/pci/pci-acpi.c =================================================================== --- linux-2.6.orig/drivers/pci/pci-acpi.c +++ linux-2.6/drivers/pci/pci-acpi.c @@ -111,17 +111,8 @@ static bool acpi_pci_can_wakeup(struct p static int acpi_pci_sleep_wake(struct pci_dev *dev, bool enable) { - int error; - - 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; + return acpi_pci_can_wakeup(dev) ? + acpi_pm_device_sleep_wake(&dev->dev, enable) : 0; } static struct pci_platform_pm_ops acpi_pci_platform_pm = {