lkml.org 
[lkml]   [2019]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] rtc: snvs: Use __maybe_unused instead of #if CONFIG_PM_SLEEP
Date
On Mon, 2019-04-29 at 07:02 +0000, Anson Huang wrote:
> Use __maybe_unused for power management related functions
> instead of #if CONFIG_PM_SLEEP to simply the code.
>
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

This will result in the functions always being included, even if
PM_SLEEP is off...

>
> @@ -387,14 +385,6 @@ static const struct dev_pm_ops snvs_rtc_pm_ops = {
> .resume_noirq = snvs_rtc_resume_noirq,
> };

...because they will always be used by the definition of
snvs_rtc_pm_ops here.

In order for this to work, SIMPLE_DEV_PM_OPS() needs to be used,
so that the dev_pm_ops struct is empty when PM is off and the functions
don't get referenced. See: https://lkml.org/lkml/2019/1/17/376
\
 
 \ /
  Last update: 2019-04-29 19:13    [W:0.111 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site