From: Nathan Chancellor <nathan@kernel.org>
To: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Cai Huoqing <caihuoqing@baidu.com>,
linux-kernel@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] pcmcia: Guard yenta_dev_{resume,suspend}_noirq() on CONFIG_PM_SLEEP
Date: Tue, 11 Jan 2022 09:50:04 -0700 [thread overview]
Message-ID: <20220111165004.1764190-1-nathan@kernel.org> (raw)
When building without CONFIG_PM_SLEEP:
drivers/pcmcia/yenta_socket.c:1322:12: error: ‘yenta_dev_resume_noirq’ defined but not used [-Werror=unused-function]
1322 | static int yenta_dev_resume_noirq(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/pcmcia/yenta_socket.c:1303:12: error: ‘yenta_dev_suspend_noirq’ defined but not used [-Werror=unused-function]
1303 | static int yenta_dev_suspend_noirq(struct device *dev)
| ^~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS evaluates to an empty macro when
CONFIG_PM_SLEEP is not set. Every callback in yenta_pm_ops depends on
CONFIG_PM_SLEEP to work properly so just guard this whole block on
CONFIG_PM_SLEEP, rather than CONFIG_PM, which CONFIG_PM_SLEEP will
select.
Fixes: 3daaf2c7aae8 ("pcmcia: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/pcmcia/yenta_socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 837877daed62..3966a6ceb1ac 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -1299,7 +1299,7 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
return ret;
}
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
static int yenta_dev_suspend_noirq(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
base-commit: fbb3485f1f931102d8ba606f1c28123f5b48afa3
--
2.34.1
next reply other threads:[~2022-01-11 16:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-11 16:50 Nathan Chancellor [this message]
2022-01-12 4:56 ` Dominik Brodowski
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=20220111165004.1764190-1-nathan@kernel.org \
--to=nathan@kernel.org \
--cc=caihuoqing@baidu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
/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
Powered by JetHome