From: Eduardo Valentin Date: Tue, 8 Nov 2016 05:08:53 +0000 (-0800) Subject: thermal: core: remove unnecessary device_remove() calls X-Git-Tag: v4.10-rc1~160^2~1^4~34 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2a4806bf7afd37c719b10099415318a9936a3293;p=karo-tx-linux.git thermal: core: remove unnecessary device_remove() calls Given that cdevs sysfs properties are already registered using the dev.groups, there is no need to explicitly call device_remove() for each property. Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index b1d6de9185f4..6100ae70ccfb 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1876,11 +1876,6 @@ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev) mutex_unlock(&thermal_list_lock); - if (cdev->type[0]) - device_remove_file(&cdev->device, &dev_attr_cdev_type); - device_remove_file(&cdev->device, &dev_attr_max_state); - device_remove_file(&cdev->device, &dev_attr_cur_state); - release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); device_unregister(&cdev->device); return;