OSDN Git Service

thermal: core: Use device_unregister() instead of device_del/put()
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 18 Jan 2023 08:38:26 +0000 (14:08 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 24 Jan 2023 19:22:55 +0000 (20:22 +0100)
Lets not open code device_unregister() unnecessarily.

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

index 3ce2a6e..d77c1c4 100644 (file)
@@ -1105,8 +1105,7 @@ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
 
        mutex_unlock(&thermal_list_lock);
 
-       device_del(&cdev->device);
-       put_device(&cdev->device);
+       device_unregister(&cdev->device);
 }
 EXPORT_SYMBOL_GPL(thermal_cooling_device_unregister);