mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Bin Liu <b-liu@ti.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>,
	Felipe Balbi <balbi@kernel.org>, Johan Hovold <johan@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] usb: musb: mark PM functions as __maybe_unused
Date: Tue, 22 Nov 2016 15:30:15 +0100	[thread overview]
Message-ID: <20161122143028.1822041-1-arnd@arndb.de> (raw)

Building without CONFIG_PM causes a harmless warning:

drivers/usb/musb/musb_core.c:2041:12: error: ‘musb_run_resume_work’ defined but not used [-Werror=unused-function]

Removing the #ifdef around the PM code and instead marking the suspend/resume
functions as __maybe_unused will do the right thing without warning.

Fixes: ea2f35c01d5e ("usb: musb: Fix sleeping function called from invalid context for hdrc glue")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/usb/musb/musb_core.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index c3e172e15ec3..cc8192f1f2af 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2485,8 +2485,6 @@ static int musb_remove(struct platform_device *pdev)
 	return 0;
 }
 
-#ifdef	CONFIG_PM
-
 static void musb_save_context(struct musb *musb)
 {
 	int i;
@@ -2640,7 +2638,7 @@ static void musb_restore_context(struct musb *musb)
 	musb_writeb(musb_base, MUSB_INDEX, musb->context.index);
 }
 
-static int musb_suspend(struct device *dev)
+static int __maybe_unused musb_suspend(struct device *dev)
 {
 	struct musb	*musb = dev_to_musb(dev);
 	unsigned long	flags;
@@ -2667,7 +2665,7 @@ static int musb_suspend(struct device *dev)
 	return 0;
 }
 
-static int musb_resume(struct device *dev)
+static int __maybe_unused musb_resume(struct device *dev)
 {
 	struct musb *musb = dev_to_musb(dev);
 	unsigned long flags;
@@ -2717,7 +2715,7 @@ static int musb_resume(struct device *dev)
 	return 0;
 }
 
-static int musb_runtime_suspend(struct device *dev)
+static int __maybe_unused musb_runtime_suspend(struct device *dev)
 {
 	struct musb	*musb = dev_to_musb(dev);
 
@@ -2727,7 +2725,7 @@ static int musb_runtime_suspend(struct device *dev)
 	return 0;
 }
 
-static int musb_runtime_resume(struct device *dev)
+static int __maybe_unused musb_runtime_resume(struct device *dev)
 {
 	struct musb *musb = dev_to_musb(dev);
 	unsigned long flags;
@@ -2771,16 +2769,11 @@ static const struct dev_pm_ops musb_dev_pm_ops = {
 	.runtime_resume = musb_runtime_resume,
 };
 
-#define MUSB_DEV_PM_OPS (&musb_dev_pm_ops)
-#else
-#define	MUSB_DEV_PM_OPS	NULL
-#endif
-
 static struct platform_driver musb_driver = {
 	.driver = {
 		.name		= (char *)musb_driver_name,
 		.bus		= &platform_bus_type,
-		.pm		= MUSB_DEV_PM_OPS,
+		.pm		= &musb_dev_pm_ops,
 	},
 	.probe		= musb_probe,
 	.remove		= musb_remove,
-- 
2.9.0

             reply	other threads:[~2016-11-22 14:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22 14:30 Arnd Bergmann [this message]
2016-11-23 14:20 ` Tony Lindgren
2016-11-28 10:51 ` Geert Uytterhoeven
2016-11-28 10:54   ` Arnd Bergmann
2016-11-28 11:09     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161122143028.1822041-1-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=b-liu@ti.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®