From 874db600a97c9e814f3bc53574a555fb554ffbad Mon Sep 17 00:00:00 2001 From: Jinyoung Park Date: Thu, 29 May 2014 02:11:11 +0900 Subject: [PATCH] thermal: generic-adc-thermal: Add shutdown callback Added shutdown callback function to prevent unwanted thermal zone operating while shutdown processing. Bug 1515432 Change-Id: I54822fa6fe4a1af811b11324c5c378904c11f654 Signed-off-by: Jinyoung Park Reviewed-on: http://git-master/r/416247 (cherry picked from commit d587035a252ca5c579db4ad8fad1756259a2566c) Reviewed-on: http://git-master/r/427500 GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan Tested-by: Laxman Dewangan --- drivers/thermal/generic_adc_thermal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/thermal/generic_adc_thermal.c b/drivers/thermal/generic_adc_thermal.c index 58f3a76d516..55dd95527de 100644 --- a/drivers/thermal/generic_adc_thermal.c +++ b/drivers/thermal/generic_adc_thermal.c @@ -505,6 +505,12 @@ static int gadc_thermal_remove(struct platform_device *pdev) return 0; } +static void gadc_thermal_shutdown(struct platform_device *pdev) +{ + struct gadc_thermal_driver_data *drvdata = platform_get_drvdata(pdev); + thermal_zone_device_unregister(drvdata->tz); +} + static struct platform_driver gadc_thermal_driver = { .driver = { .name = "generic-adc-thermal", @@ -512,6 +518,7 @@ static struct platform_driver gadc_thermal_driver = { }, .probe = gadc_thermal_probe, .remove = gadc_thermal_remove, + .shutdown = gadc_thermal_shutdown, }; module_platform_driver(gadc_thermal_driver); -- 2.39.2