浏览代码

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 <eduardo.valentin@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Eduardo Valentin 12 年之前
父节点
当前提交
262235b13c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/staging/ti-soc-thermal/ti-bandgap.c

+ 1 - 1
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)