• Bjorn Helgaas's avatar
    PM: wakeup: Unify device_init_wakeup() for PM_SLEEP and !PM_SLEEP · 09d3154a
    Bjorn Helgaas authored
    Previously the CONFIG_PM_SLEEP and !CONFIG_PM_SLEEP device_init_wakeup()
    implementations differed in confusing ways:
    
      - The PM_SLEEP version checked for a NULL device pointer and returned
        -EINVAL, while the !PM_SLEEP version did not and would simply
        dereference a NULL pointer.
    
      - When called with "false", the !PM_SLEEP version cleared "capable" and
        "enable" in the opposite order of the PM_SLEEP version.  That was
        harmless because for !PM_SLEEP they're simple assignments, but it's
        unnecessary confusion.
    
    Use a simplified version of the PM_SLEEP implementation for both cases.
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    09d3154a
wakeup.c 30.9 KB