• Yangtao Li's avatar
    PM / core: Introduce dpm_async_fn() helper · f2a424f6
    Yangtao Li authored
    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: default avatarYangtao Li <tiny.windzz@gmail.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    f2a424f6
main.c 52.2 KB