thermal: Drop redundant and confusing device_is_registered() checks
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 8 Dec 2023 19:19:03 +0000 (20:19 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 12 Dec 2023 12:00:28 +0000 (13:00 +0100)
commitc3ffdfff978a089f2d678571664eecd41953253d
treeb181312aba4efb0c1b7ae2812a2dd45534411d90
parent4649620d9404d3aceb25891c24bab77143e3f21c
thermal: Drop redundant and confusing device_is_registered() checks

Multiple places in the thermal subsystem (most importantly, sysfs
attribute callback functions) check if the given thermal zone device is
still registered in order to return early in case the device_del() in
thermal_zone_device_unregister() has run already.

However, after thermal_zone_device_unregister() has been made wait for
all of the zone-related activity to complete before returning, it is
not necessary to do that any more, because all of the code holding a
reference to the thermal zone device object will be waited for even if
it does not do anything special to enforce this.

Accordingly, drop all of the device_is_registered() checks that are now
redundant and get rid of the zone locking that is not necessary any more
after dropping them.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-and-tested-by: Lukasz Luba <lukasz.luba@arm.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/thermal_core.c
drivers/thermal/thermal_helpers.c
drivers/thermal/thermal_hwmon.c
drivers/thermal/thermal_sysfs.c