From: Eduardo Valentin Date: Mon, 8 Apr 2013 12:19:14 +0000 (-0400) Subject: staging: ti-soc-thermal: fix device removal X-Git-Tag: firefly_0821_release~3680^2~674^2~238 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=262235b13c22f6b7f84173f350964e71a849067d;p=firefly-linux-kernel-4.4.55.git staging: ti-soc-thermal: fix device removal While removing, the device needs to unregister the sensor from thermal framework. Before calling the call back the driver needs to check if the call back is registered. This patch fix the check by checking the right callback. Signed-off-by: Eduardo Valentin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c b/drivers/staging/ti-soc-thermal/ti-bandgap.c index 37fdba639842..f20c1cfe9800 100644 --- a/drivers/staging/ti-soc-thermal/ti-bandgap.c +++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c @@ -1369,7 +1369,7 @@ int ti_bandgap_remove(struct platform_device *pdev) /* First thing is to remove sensor interfaces */ for (i = 0; i < bgp->conf->sensor_count; i++) { - if (bgp->conf->sensors[i].register_cooling) + if (bgp->conf->sensors[i].unregister_cooling) bgp->conf->sensors[i].unregister_cooling(bgp, i); if (bgp->conf->remove_sensor)