[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1556557953.31309.4.camel@impinj.com>
Date: Mon, 29 Apr 2019 17:12:34 +0000
From: Trent Piepho <tpiepho@...inj.com>
To: "linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
"anson.huang@....com" <anson.huang@....com>,
"a.zummo@...ertech.it" <a.zummo@...ertech.it>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>
CC: "linux-imx@....com" <linux-imx@....com>
Subject: Re: [PATCH] rtc: snvs: Use __maybe_unused instead of #if
CONFIG_PM_SLEEP
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@....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
Powered by blists - more mailing lists