From: Dhruva Gole <d-gole@ti.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Tony Lindgren <tony@atomide.com>, Len Brown <len.brown@intel.com>,
Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Viresh Kumar <viresh.kumar@linaro.org>, <theo.lebrun@bootlin.com>,
<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 1/3] PM: wakeup: make device_wakeup_disable return void
Date: Mon, 18 Mar 2024 20:49:25 +0530 [thread overview]
Message-ID: <20240318151925.l5fcnbr7qcww7diw@dhruva> (raw)
In-Reply-To: <CAJZ5v0giafbnGFHgT7pZm+o6KzKznxVDJvc04K6XvP1ShG2YKw@mail.gmail.com>
On Mar 18, 2024 at 14:47:45 +0100, Rafael J. Wysocki wrote:
> On Mon, Mar 18, 2024 at 6:55 AM Dhruva Gole <d-gole@ti.com> wrote:
> >
> > The device_wakeup_disable call only returns an error if no dev exists
> > however there's not much a user can do at that point.
> > Rather make this function return void.
> >
> > Signed-off-by: Dhruva Gole <d-gole@ti.com>
> > ---
> > drivers/base/power/wakeup.c | 11 +++++++----
> > include/linux/pm_wakeup.h | 5 ++---
> > 2 files changed, 9 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
> > index a917219feea6..752b417e8129 100644
> > --- a/drivers/base/power/wakeup.c
> > +++ b/drivers/base/power/wakeup.c
> > @@ -451,16 +451,15 @@ static struct wakeup_source *device_wakeup_detach(struct device *dev)
> > * Detach the @dev's wakeup source object from it, unregister this wakeup source
> > * object and destroy it.
> > */
> > -int device_wakeup_disable(struct device *dev)
> > +void device_wakeup_disable(struct device *dev)
> > {
> > struct wakeup_source *ws;
> >
> > if (!dev || !dev->power.can_wakeup)
> > - return -EINVAL;
> > + return;
> >
> > ws = device_wakeup_detach(dev);
> > wakeup_source_unregister(ws);
> > - return 0;
> > }
> > EXPORT_SYMBOL_GPL(device_wakeup_disable);
> >
> > @@ -502,7 +501,11 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_capable);
> > */
> > int device_set_wakeup_enable(struct device *dev, bool enable)
> > {
> > - return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev);
> > + if (enable)
> > + return device_wakeup_enable(dev);
> > +
> > + device_wakeup_disable(dev);
> > + return 0;
> > }
> > EXPORT_SYMBOL_GPL(device_set_wakeup_enable);
> >
> > diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
> > index 6eb9adaef52b..428803eed798 100644
> > --- a/include/linux/pm_wakeup.h
> > +++ b/include/linux/pm_wakeup.h
> > @@ -107,7 +107,7 @@ extern void wakeup_sources_read_unlock(int idx);
> > extern struct wakeup_source *wakeup_sources_walk_start(void);
> > extern struct wakeup_source *wakeup_sources_walk_next(struct wakeup_source *ws);
> > extern int device_wakeup_enable(struct device *dev);
> > -extern int device_wakeup_disable(struct device *dev);
> > +extern void device_wakeup_disable(struct device *dev);
>
> This change will introduce a build error in sdhci-pci-core.c AFAICS,
> so you need to modify this file in the same patch to avoid bisection
> breakage.
Alright, I have respinned the series and fixed up the first patch
itself.
Thanks!
--
Best regards,
Dhruva Gole <d-gole@ti.com>
next prev parent reply other threads:[~2024-03-18 15:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-18 5:50 [PATCH 0/3] PM: wakeup: make device_wakeup_disable return void Dhruva Gole
2024-03-18 5:50 ` [PATCH 1/3] " Dhruva Gole
2024-03-18 13:47 ` Rafael J. Wysocki
2024-03-18 15:19 ` Dhruva Gole [this message]
2024-03-18 5:50 ` [PATCH 2/3] PM: wakeup: Remove unnecessary else from device_init_wakeup Dhruva Gole
2024-03-18 13:52 ` Rafael J. Wysocki
2024-03-18 15:18 ` Dhruva Gole
2024-03-18 5:50 ` [PATCH 3/3] mmc: sdhci-pci: Use device_set_wakeup_enable for en/disable wakeups Dhruva Gole
2024-03-18 13:50 ` Rafael J. Wysocki
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=20240318151925.l5fcnbr7qcww7diw@dhruva \
--to=d-gole@ti.com \
--cc=adrian.hunter@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=theo.lebrun@bootlin.com \
--cc=tony@atomide.com \
--cc=ulf.hansson@linaro.org \
--cc=viresh.kumar@linaro.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).