• Rafael J. Wysocki's avatar
    thermal: core: Drop thermal_zone_device_is_enabled() · 54fccad6
    Rafael J. Wysocki authored
    There are only two callers of thermal_zone_device_is_enabled()
    and one of them call is under the zone lock and the other one uses
    lockdep_assert_held() on that lock.  Thus the lockdep_assert_held()
    in thermal_zone_device_is_enabled() is redundant and it could be
    dropped, but then the function would merely become a wrapper around
    a simple tz->mode check that is more convenient to do directly.
    
    Accordingly, drop thermal_zone_device_is_enabled() altogether and update
    its callers to check tz->mode directly as appropriate.
    
    While at it, combine the tz->mode and tz->suspended checks in
    __thermal_zone_device_update() because they are of a similar category
    and if any of them evaluates to "true", the outcome is the same.
    
    No intentinal functional impact.
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Link: https://patch.msgid.link/9353673.CDJkKcVGEf@rjwysocki.net
    54fccad6
thermal_core.h 10.3 KB