From: Kevin Hilman <khilman@deeprootsystems.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: linux-pm@lists.linux-foundation.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: Re: [PATCH] PM: lenient generic runtime pm callbacks
Date: Tue, 07 Sep 2010 15:56:39 -0700 [thread overview]
Message-ID: <87vd6hf9i0.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1283811642-18837-1-git-send-email-ohad@wizery.com> (Ohad Ben-Cohen's message of "Tue, 7 Sep 2010 01:20:42 +0300")
Ohad Ben-Cohen <ohad@wizery.com> writes:
> Allow drivers, that belong to subsystems which use the generic
> runtime pm callbacks, not to define runtime pm suspend/resume handlers,
> by implicitly assuming success in such cases.
>
> This is needed to eliminate nop handlers that would otherwise be
> necessary by drivers which enable runtime pm, but don't need
> to do anything when their devices are runtime-suspended/resumed.
>
> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
for runtime PM of on-chip devices on OMAP, this will cleanup several nop
handlers we have had to put in place.
FWIW, the 'no_callbacks' approach won't work for runtime PM of on-chip
devices for us since most of the devices will have callbacks, only some
will not need them.
Kevin
> ---
> drivers/base/power/generic_ops.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/power/generic_ops.c b/drivers/base/power/generic_ops.c
> index 4b29d49..81f2c84 100644
> --- a/drivers/base/power/generic_ops.c
> +++ b/drivers/base/power/generic_ops.c
> @@ -46,7 +46,7 @@ int pm_generic_runtime_suspend(struct device *dev)
> const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> int ret;
>
> - ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : -EINVAL;
> + ret = pm && pm->runtime_suspend ? pm->runtime_suspend(dev) : 0;
>
> return ret;
> }
> @@ -65,7 +65,7 @@ int pm_generic_runtime_resume(struct device *dev)
> const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
> int ret;
>
> - ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : -EINVAL;
> + ret = pm && pm->runtime_resume ? pm->runtime_resume(dev) : 0;
>
> return ret;
> }
next prev parent reply other threads:[~2010-09-07 22:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-06 22:20 [PATCH] PM: lenient generic runtime pm callbacks Ohad Ben-Cohen
2010-09-07 22:56 ` Kevin Hilman [this message]
2010-09-08 10:55 ` Mark Brown
2010-09-08 23:46 ` 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=87vd6hf9i0.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-pm@lists.linux-foundation.org \
--cc=ohad@wizery.com \
/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