[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=Uxw+M-+-P=0z9K558RhzZA+XPA7thVTbcU2z3pL3eU5w@mail.gmail.com>
Date: Wed, 15 Jan 2020 11:47:49 -0800
From: Doug Anderson <dianders@...omium.org>
To: Stephen Boyd <swboyd@...omium.org>
Cc: John Stultz <john.stultz@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ravi Chandra Sadineni <ravisadineni@...omium.org>,
LKML <linux-kernel@...r.kernel.org>,
Stephen Boyd <sboyd@...nel.org>
Subject: Re: [PATCH 3/4] alarmtimer: Use wakeup source from alarmtimer
platform device
Hi,
On Thu, Jan 9, 2020 at 7:59 AM Stephen Boyd <swboyd@...omium.org> wrote:
>
> Use the wakeup source that can be associated with the 'alarmtimer'
> platform device instead of registering another one by hand.
>
> Signed-off-by: Stephen Boyd <swboyd@...omium.org>
> ---
> kernel/time/alarmtimer.c | 13 ++++---------
> 1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
> index ccb6aea4f1d4..be057638e89d 100644
> --- a/kernel/time/alarmtimer.c
> +++ b/kernel/time/alarmtimer.c
> @@ -55,8 +55,6 @@ static DEFINE_SPINLOCK(freezer_delta_lock);
> #endif
>
> #ifdef CONFIG_RTC_CLASS
> -static struct wakeup_source *ws;
> -
> /* rtc timer and device for setting alarm wakeups at suspend */
> static struct rtc_timer rtctimer;
> static struct rtc_device *rtcdev;
> @@ -87,7 +85,6 @@ static int alarmtimer_rtc_add_device(struct device *dev,
> {
> unsigned long flags;
> struct rtc_device *rtc = to_rtc_device(dev);
> - struct wakeup_source *__ws;
> struct platform_device *pdev;
> int ret = 0;
>
> @@ -99,8 +96,9 @@ static int alarmtimer_rtc_add_device(struct device *dev,
> if (!device_may_wakeup(rtc->dev.parent))
> return -1;
>
> - __ws = wakeup_source_register(dev, "alarmtimer");
> pdev = platform_device_register_data(dev, "alarmtimer", -1, NULL, 0);
> + if (pdev)
It appears that the error case for platform_device_register_data()
needs to be checked with by IS_ERR().
Other than that, this seems like a sane idea to me and a nice cleanup.
With my usual caveat that I'm reviewing code that I'm by no means an
expert in, feel free to add my Reviewed-by with that change.
-Doug
Powered by blists - more mailing lists