thermal: core: Move cdev cleanup to thermal_release()
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 18 Jan 2023 08:38:25 +0000 (14:08 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 24 Jan 2023 19:21:49 +0000 (20:21 +0100)
commite398421fd03cf70c8d6e1d69a0773ee2fc426b25
tree93aaa9f9b40aeb2d6d10963bb7d1acfffde820ac
parenta2c81dc59d41e92362ab7d41d0c15471ea50637d
thermal: core: Move cdev cleanup to thermal_release()

thermal_release() already frees cdev, let it do rest of the cleanup as
well in order to simplify the error paths in
__thermal_cooling_device_register().

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_core.c