]> git.baikalelectronics.ru Git - kernel.git/commit
PM: runtime: Improve path in rpm_idle() when no callback
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 8 Jun 2021 09:02:48 +0000 (11:02 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 11 Jun 2021 17:03:01 +0000 (19:03 +0200)
commit32b1133a4bde4a73f6af41841a28ddaa914d6875
treee369c247f85b683d8b2d1a43f1feee1efb6474f0
parent6dd599f41a33ed85b665b1aa50b5ba27494eeb3a
PM: runtime: Improve path in rpm_idle() when no callback

When pm_runtime_no_callbacks() has been called for a struct device to set
the dev->power.no_callbacks flag for it, it enables rpm_idle() to take a
slightly quicker path by assuming that a ->runtime_idle() callback would
have returned 0 to indicate success.

A device that does not have the dev->power.no_callbacks flag set for it,
may still be missing a corresponding ->runtime_idle() callback, in which
case the slower path in rpm_idle() is taken. Let's improve the behaviour
for this case, by aligning code to the quicker path.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/runtime.c