PM: suspend: Use valid_state() consistently
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 22 Oct 2021 15:53:43 +0000 (17:53 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 26 Oct 2021 13:52:58 +0000 (15:52 +0200)
commit9f6abfcd67aae51374b4e8aa0b11f0ebd0d8562f
tree8ecb86974b41d863bc96629eaab3085b2156d154
parent23f62d7ab25bd1a7dbbb89cfcd429df7735855af
PM: suspend: Use valid_state() consistently

Make valid_state() check if the ->enter callback is present in
suspend_ops (only PM_SUSPEND_TO_IDLE can be valid otherwise) and
make sleep_state_supported() call valid_state() consistently to
validate the states other than PM_SUSPEND_TO_IDLE.

While at it, clean up the comment in valid_state().

No expected functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/power/suspend.c