From: Bui Duc Phuc Date: Mon, 22 Aug 2016 03:19:49 +0000 (+0000) Subject: thermal: rcar_thermal: don't call thermal_zone_device_unregister when USE_OF_THERMAL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4b23c5c434a7af053782cc0f9eebee51ec71bb2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git thermal: rcar_thermal: don't call thermal_zone_device_unregister when USE_OF_THERMAL devm_thermal_zone_of_sensor_register() case doesn't need to call thermal_zone_device_unregister(). Otherwise, rcar-thermal can't register thermal zone again after rebind. This patch fixes it. Signed-off-by: Bui Duc Phuc Signed-off-by: Kuninori Morimoto Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4d07644da649..b5c6442d82d6 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -419,9 +419,10 @@ static int rcar_thermal_remove(struct platform_device *pdev) rcar_thermal_for_each_priv(priv, common) { rcar_thermal_irq_disable(priv); - thermal_zone_device_unregister(priv->zone); if (rcar_use_of_thermal(dev)) thermal_remove_hwmon_sysfs(priv->zone); + else + thermal_zone_device_unregister(priv->zone); } pm_runtime_put(dev);