* [PATCH] regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq
@ 2018-12-20 13:14 Axel Lin
2018-12-21 11:17 ` Nicolas.Ferre
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2018-12-20 13:14 UTC (permalink / raw)
To: Mark Brown
Cc: Axel Lin, Andrei Stefanescu, Liam Girdwood, linux-arm-kernel,
linux-kernel
mcp16502_suspend/resume_noirq is only used by SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
when CONFIG_PM_SLEEP is defined.
So use #ifdef CONFIG_PM_SLEEP instead CONFIG_SUSPEND guard.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
This patch replaces below patch I sent today.
regulator: mcp16502: Fix build error when !CONFIG_SUSPEND && CONFIG_PM_SLEEP
Changed the subject line because after commit 308144ce8e51 ("regulator: mcp16502: code cleanup")
it's not related to build error now.
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 809a664733a4..cb11fb206899 100644
--- a/drivers/regulator/mcp16502.c
+++ b/drivers/regulator/mcp16502.c
@@ -497,7 +497,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);
@@ -517,10 +517,7 @@ static int mcp16502_resume_noirq(struct device *dev)
return 0;
}
-#else /* !CONFIG_SUSPEND */
-#define mcp16502_suspend_noirq NULL
-#define mcp16502_resume_noirq NULL
-#endif /* !CONFIG_SUSPEND */
+#endif
#ifdef CONFIG_PM
static const struct dev_pm_ops mcp16502_pm_ops = {
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq
2018-12-20 13:14 [PATCH] regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq Axel Lin
@ 2018-12-21 11:17 ` Nicolas.Ferre
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas.Ferre @ 2018-12-21 11:17 UTC (permalink / raw)
To: axel.lin, broonie
Cc: Andrei.Stefanescu, lgirdwood, linux-kernel, Ludovic.Desroches,
Claudiu.Beznea, linux-arm-kernel
On 20/12/2018 at 14:14, Axel Lin wrote:
> mcp16502_suspend/resume_noirq is only used by SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
> when CONFIG_PM_SLEEP is defined.
> So use #ifdef CONFIG_PM_SLEEP instead CONFIG_SUSPEND guard.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
I'm not against this patch and don't know the habits about this... one
remark below...
> ---
> This patch replaces below patch I sent today.
> regulator: mcp16502: Fix build error when !CONFIG_SUSPEND && CONFIG_PM_SLEEP
> Changed the subject line because after commit 308144ce8e51 ("regulator: mcp16502: code cleanup")
> it's not related to build error now.
>
> 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 809a664733a4..cb11fb206899 100644
> --- a/drivers/regulator/mcp16502.c
> +++ b/drivers/regulator/mcp16502.c
> @@ -497,7 +497,7 @@ static int mcp16502_probe(struct i2c_client *client,
> return 0;
> }
>
> -#ifdef CONFIG_SUSPEND
> +#ifdef CONFIG_PM_SLEEP
Why not use CONFIG_PM just like ...
> static int mcp16502_suspend_noirq(struct device *dev)
> {
> struct i2c_client *client = to_i2c_client(dev);
> @@ -517,10 +517,7 @@ static int mcp16502_resume_noirq(struct device *dev)
>
> return 0;
> }
> -#else /* !CONFIG_SUSPEND */
> -#define mcp16502_suspend_noirq NULL
> -#define mcp16502_resume_noirq NULL
> -#endif /* !CONFIG_SUSPEND */
> +#endif
>
> #ifdef CONFIG_PM
... here.... or unify both directives to "CONFIG_PM_SLEEP" ?
Otherwise, no problem in adding my:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
(as Andrei is not with Microchip anymore).
> static const struct dev_pm_ops mcp16502_pm_ops = {
>
--
Nicolas Ferre
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-21 11:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20 13:14 [PATCH] regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq Axel Lin
2018-12-21 11:17 ` Nicolas.Ferre
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).