linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Doug Anderson <dianders@chromium.org>
To: Stephen Boyd <swboyd@chromium.org>
Cc: John Stultz <john.stultz@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ravi Chandra Sadineni <ravisadineni@chromium.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephen Boyd <sboyd@kernel.org>
Subject: Re: [PATCH 3/4] alarmtimer: Use wakeup source from alarmtimer platform device
Date: Wed, 15 Jan 2020 11:47:49 -0800	[thread overview]
Message-ID: <CAD=FV=Uxw+M-+-P=0z9K558RhzZA+XPA7thVTbcU2z3pL3eU5w@mail.gmail.com> (raw)
In-Reply-To: <20200109155910.907-4-swboyd@chromium.org>

Hi,

On Thu, Jan 9, 2020 at 7:59 AM Stephen Boyd <swboyd@chromium.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@chromium.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

  reply	other threads:[~2020-01-15 19:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 15:59 [PATCH 0/4] Fix alarmtimer suspend failure Stephen Boyd
2020-01-09 15:59 ` [PATCH 1/4] alarmtimer: Unregister wakeup source when module get fails Stephen Boyd
2020-01-15  3:40   ` Doug Anderson
2020-01-15 10:24   ` [tip: timers/core] " tip-bot2 for Stephen Boyd
2020-01-09 15:59 ` [PATCH 2/4] alarmtimer: Make alarmtimer platform device child of RTC device Stephen Boyd
2020-01-15  3:40   ` Doug Anderson
2020-01-15 10:07     ` Thomas Gleixner
2020-01-15 16:47       ` Stephen Boyd
2020-01-15 19:32         ` Doug Anderson
2020-01-15 19:22       ` Doug Anderson
2020-01-17  1:25         ` Stephen Boyd
2020-01-09 15:59 ` [PATCH 3/4] alarmtimer: Use wakeup source from alarmtimer platform device Stephen Boyd
2020-01-15 19:47   ` Doug Anderson [this message]
2020-01-09 15:59 ` [PATCH 4/4] alarmtimer: Always export alarmtimer_get_rtcdev() and update docs Stephen Boyd
2020-01-15 20:31   ` Doug Anderson

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='CAD=FV=Uxw+M-+-P=0z9K558RhzZA+XPA7thVTbcU2z3pL3eU5w@mail.gmail.com' \
    --to=dianders@chromium.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ravisadineni@chromium.org \
    --cc=sboyd@kernel.org \
    --cc=swboyd@chromium.org \
    --cc=tglx@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).