MLK-12219 thermal: imx: unregister busfreq_notifier in thermal_remove
authorBai Ping <ping.bai@nxp.com>
Tue, 12 Jan 2016 08:27:46 +0000 (16:27 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:44 +0000 (14:49 -0500)
unregister the busfreq_notifier when the thermal driver is removed.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
drivers/thermal/imx_thermal.c

index a4fb898..4896244 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2013-2015 Freescale Semiconductor, Inc.
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -919,6 +919,10 @@ static int imx_thermal_remove(struct platform_device *pdev)
        if (!IS_ERR(data->thermal_clk))
                clk_disable_unprepare(data->thermal_clk);
 
+       /* unregister the busfreq notifier called in low bus freq */
+       if (data->socdata->version != TEMPMON_IMX7)
+               unregister_busfreq_notifier(&thermal_notifier);
+
        thermal_zone_device_unregister(data->tz);
        cpufreq_cooling_unregister(data->cdev[0]);
        devfreq_cooling_unregister(data->cdev[1]);