From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Andrei Stefanescu <andrei.stefanescu@microchip.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH] regulator: mcp16502: Fix build error when !CONFIG_SUSPEND && CONFIG_PM_SLEEP
Date: Thu, 20 Dec 2018 17:38:28 +0800 [thread overview]
Message-ID: <20181220093828.28821-1-axel.lin@ingics.com> (raw)
Use #ifdef CONFIG_PM_SLEEP guard around suspend_fn/resume_fn to fix below
build error.
CC [M] drivers/regulator/mcp16502.o
In file included from ./include/linux/device.h:23:0,
from ./include/linux/gpio/driver.h:5,
from ./include/asm-generic/gpio.h:13,
from ./include/linux/gpio.h:62,
from drivers/regulator/mcp16502.c:11:
drivers/regulator/mcp16502.c:528:32: error: ‘mcp16502_suspend_noirq’ undeclared here (not in a function); did you mean ‘mcp16502_suspend’?
SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mcp16502_suspend_noirq,
^
./include/linux/pm.h:342:19: note: in definition of macro ‘SET_NOIRQ_SYSTEM_SLEEP_PM_OPS’
.suspend_noirq = suspend_fn, \
^~~~~~~~~~
drivers/regulator/mcp16502.c:529:10: error: ‘mcp16502_resume_noirq’ undeclared here (not in a function); did you mean ‘mcp16502_suspend_noirq’?
mcp16502_resume_noirq)
^
./include/linux/pm.h:343:18: note: in definition of macro ‘SET_NOIRQ_SYSTEM_SLEEP_PM_OPS’
.resume_noirq = resume_fn, \
^~~~~~~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/mcp16502.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/mcp16502.c b/drivers/regulator/mcp16502.c
index ec5b6836a20c..2507acb7f5dc 100644
--- a/drivers/regulator/mcp16502.c
+++ b/drivers/regulator/mcp16502.c
@@ -498,7 +498,7 @@ static int mcp16502_probe(struct i2c_client *client,
return 0;
}
-#ifdef CONFIG_SUSPEND
+#ifdef CONFIG_PM_SLEEP
static int mcp16502_suspend_noirq(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
@@ -518,10 +518,7 @@ static int mcp16502_resume_noirq(struct device *dev)
return 0;
}
-#else /* !CONFIG_SUSPEND */
-#define mcp16502_suspend NULL
-#define mcp16502_resume NULL
-#endif /* !CONFIG_SUSPEND */
+#endif
#ifdef CONFIG_PM
static const struct dev_pm_ops mcp16502_pm_ops = {
--
2.17.1
reply other threads:[~2018-12-20 9:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20181220093828.28821-1-axel.lin@ingics.com \
--to=axel.lin@ingics.com \
--cc=andrei.stefanescu@microchip.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/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®