]> git.baikalelectronics.ru Git - kernel.git/commit
PM: runtime: Return -EINPROGRESS from rpm_resume() in the RPM_NOWAIT case
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 22 Sep 2022 18:04:40 +0000 (20:04 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 24 Sep 2022 17:28:51 +0000 (19:28 +0200)
commit88b8952e10ace9442885973a2dbef820da6de109
tree58023082f3deebb5d6eb02de33e908948732ac3f
parent27f9b03c399355c5a93e7f1cf491765f72d4bb7d
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/base/power/runtime.c