From patchwork Wed Aug 8 14:47:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10597 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EF80023E53 for ; Wed, 8 Aug 2012 14:47:53 +0000 (UTC) Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id ABCFEA1905B for ; Wed, 8 Aug 2012 14:47:53 +0000 (UTC) Received: by qcmv28 with SMTP id v28so480838qcm.11 for ; Wed, 08 Aug 2012 07:47:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-provags-id:x-gm-message-state; bh=vrlKO11aN9raACdm7GOuqDHfXpUWEN4WO3cZlTwYXzc=; b=CAfaZoIZE+lUcm8HNXJE+x+Jti1O0c6R/+ftRh/4UM9vBE07D21fSxOeEZgdhhy3rl cW6lv1QT+JpUd2RwDB7zV8UKU6/RVDtk/dI5+hrqvf2pGHwlvL9Y+Vzyo/Zd+PkQs2/X AXr3KDOSy6y5wEsaGTgNRVdKgtC9TcsctbkHqgbB4Q74viuSYO9jvE4n1x7YdWQm5uWr IZodjAmtfXpO9n3AN28w8UTfLEcxOMgoU1/Tqp0Hrfby15zD1l/NS2eNP3ayiAXcQwRx 3zaK2IPPGw8PTuJw2aU/+kFKJImLC4vWczfgZbWB7m/fC+BXlIAEe1QRnaBeLjeqth0W 8Vcw== Received: by 10.50.159.135 with SMTP id xc7mr1268694igb.9.1344437272902; Wed, 08 Aug 2012 07:47:52 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp611893igc; Wed, 8 Aug 2012 07:47:52 -0700 (PDT) Received: by 10.205.136.194 with SMTP id il2mr7795099bkc.81.1344437271842; Wed, 08 Aug 2012 07:47:51 -0700 (PDT) Received: from moutng.kundenserver.de (moutng.kundenserver.de. [212.227.17.10]) by mx.google.com with ESMTP id gi2si23793453bkc.143.2012.08.08.07.47.51; Wed, 08 Aug 2012 07:47:51 -0700 (PDT) Received-SPF: neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) client-ip=212.227.17.10; Authentication-Results: mx.google.com; spf=neutral (google.com: 212.227.17.10 is neither permitted nor denied by best guess record for domain of arnd@arndb.de) smtp.mail=arnd@arndb.de Received: from klappe2.boeblingen.de.ibm.com (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Lfps2-1TVeHz25iE-00ohIc; Wed, 08 Aug 2012 16:47:37 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Cc: arm@kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , "Rafael J. Wysocki" , Takashi Iwai , Laxman Dewangan Subject: [PATCH 11/11] pm/drivers: fix use of SIMPLE_DEV_PM_OPS Date: Wed, 8 Aug 2012 16:47:28 +0200 Message-Id: <1344437248-20560-12-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1344437248-20560-1-git-send-email-arnd@arndb.de> References: <1344437248-20560-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:MOhDXT9K+NWIEE/E9QfxE8RuabvaXvWwG/MsLf5HY4K 2t7bBzwlmg1roKjs7YaF8Tbq8osJBIHYeAu/OFzvh+XxT3ajto gT42mvevW/n/ANfKZvseGBfUv7/aZYYlxragBLlzEgQv/uA/V1 zZmbZqX61qEsNdg1m23pCL4gY28d0AvoQvgx045zycsZ6B6XaA htopzx2QexPmU5UzAR2ydoTjlXJL8Wampq73C0d+P8jeYJvTtm tKcjwSVAqlzgllUN9CNp6SJX7tS37c/s6ain/yaXs4XwRYr1KW w/8KH2ztW3NJA7NdptHYi/GObYzydX4Ks5jfKfHlMN31NM+jFN nw4hFpqKPEPJ/XPpRQHY61CNZnLZaDaOtmE9NiU/rDZ98qzeGc V0kHYScyfMTHWlsGNuxrDrKWAlVDXT56tE= X-Gm-Message-State: ALoCoQncgilyXY+s/9IQuEPR4GR5Fqs5k9fygKV8ljwRZPNXUY2ms1v+uiRr/YKsTEdyQHjk45eb A few drivers use a construct like #ifdef CONFIG_PM static int foo_suspend(struct device *pdev) { ... } static int foo_resume struct device *pdev) { ... } #endif static SIMPLE_DEV_PM_OPS(foo_pm, foo_suspend, foo_resume); which leaves the two functions unused if CONFIG_PM is enabled but CONFIG_PM_SLEEP is disabled. I found this while building all defconfig files on ARM. It's not clear to me if this is the right solution, but at least it makes the code consistent again. Without this patch, building omap1_defconfig results in: drivers/char/hw_random/omap-rng.c:165:12: warning: 'omap_rng_suspend' defined but not used [-Wunused-function] drivers/char/hw_random/omap-rng.c:171:12: warning: 'omap_rng_resume' defined but not used [-Wunused-function] sound/drivers/dummy.c:1068:12: warning: 'snd_dummy_suspend' defined but not used [-Wunused-function] sound/drivers/dummy.c:1078:12: warning: 'snd_dummy_resume' defined but not used [-Wunused-function] and building tegra_defconfig results in: drivers/i2c/busses/i2c-tegra.c:716:12: warning: 'tegra_i2c_suspend' defined but not used [-Wunused-function] drivers/i2c/busses/i2c-tegra.c:727:12: warning: 'tegra_i2c_resume' defined but not used [-Wunused-function] Signed-off-by: Arnd Bergmann Cc: Rafael J. Wysocki Cc: Takashi Iwai Cc: Laxman Dewangan --- drivers/char/hw_random/omap-rng.c | 2 +- drivers/i2c/busses/i2c-tegra.c | 2 +- sound/drivers/dummy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index d706bd0e..4fbdceb 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c @@ -160,7 +160,7 @@ static int __exit omap_rng_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int omap_rng_suspend(struct device *dev) { diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 66eb53f..9a08c57 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -712,7 +712,7 @@ static int __devexit tegra_i2c_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int tegra_i2c_suspend(struct device *dev) { struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev); diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index f7d3bfc..54bb664 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -1064,7 +1064,7 @@ static int __devexit snd_dummy_remove(struct platform_device *devptr) return 0; } -#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP static int snd_dummy_suspend(struct device *pdev) { struct snd_card *card = dev_get_drvdata(pdev);