提交 e66332a4 编写于 作者: R Rafael J. Wysocki

PM: runtime: Return -EINPROGRESS from rpm_resume() in the RPM_NOWAIT case

The prospective callers of rpm_resume() passing RPM_NOWAIT to it may
be confused when it returns 0 without actually resuming the device
which may happen if the device is suspending at the given time and it
will only resume when the suspend in progress has completed.  To avoid
that confusion, return -EINPROGRESS from rpm_resume() in that case.

Since none of the current callers passing RPM_NOWAIT to rpm_resume()
check its return value, this change has no functional impact.
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Reviewed-by: NDouglas Anderson <dianders@chromium.org>
Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 521a547c
...@@ -792,10 +792,13 @@ static int rpm_resume(struct device *dev, int rpmflags) ...@@ -792,10 +792,13 @@ static int rpm_resume(struct device *dev, int rpmflags)
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
if (rpmflags & (RPM_ASYNC | RPM_NOWAIT)) { if (rpmflags & (RPM_ASYNC | RPM_NOWAIT)) {
if (dev->power.runtime_status == RPM_SUSPENDING) if (dev->power.runtime_status == RPM_SUSPENDING) {
dev->power.deferred_resume = true; dev->power.deferred_resume = true;
else if (rpmflags & RPM_NOWAIT)
retval = -EINPROGRESS;
} else {
retval = -EINPROGRESS; retval = -EINPROGRESS;
}
goto out; goto out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册