OSDN Git Service

PM / core: Introduce dpm_async_fn() helper
authorYangtao Li <tiny.windzz@gmail.com>
Sat, 16 Mar 2019 04:59:25 +0000 (00:59 -0400)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 10 Apr 2019 08:03:22 +0000 (10:03 +0200)
commitf2a424f6c613a98560dc49fd9984589401d51648
treec0b236133992b2d6074215ba8cfc6bc14573345c
parent0b237cb2fc7b10b2c4e92477760fa7442847c804
PM / core: Introduce dpm_async_fn() helper

When we want to execute device pm functions asynchronously, we'll
do the following for the device:

  1) reinit_completion(&dev->power.completion);
  2) Check if the device enables asynchronous suspend.
  3) If necessary, execute the corresponding function asynchronously.

There are a lot of such repeated operations here, in fact we can avoid
this. So introduce dpm_async_fn() to have better code readability and
reuse.

And use this function to do some cleanup.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/main.c