[PATCH RFC 059/111] staging: etnaviv: move hangcheck disable to separate function

Lucas Stach l.stach at pengutronix.de
Thu Apr 2 08:30:01 PDT 2015


From: Russell King <rmk+kernel at arm.linux.org.uk>

Provide a function to safely take down the hangcheck timer and
workqueue.

Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
---
 drivers/staging/etnaviv/etnaviv_gpu.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/etnaviv/etnaviv_gpu.c b/drivers/staging/etnaviv/etnaviv_gpu.c
index 0547e93972e6..24ed14804ebd 100644
--- a/drivers/staging/etnaviv/etnaviv_gpu.c
+++ b/drivers/staging/etnaviv/etnaviv_gpu.c
@@ -708,6 +708,12 @@ static void hangcheck_handler(unsigned long data)
 		hangcheck_timer_reset(gpu);
 }
 
+static void hangcheck_disable(struct etnaviv_gpu *gpu)
+{
+	del_timer_sync(&gpu->hangcheck_timer);
+	cancel_work_sync(&gpu->recover_work);
+}
+
 /*
  * event management:
  */
@@ -934,9 +940,7 @@ static void etnaviv_gpu_unbind(struct device *dev, struct device *master,
 
 	DBG("%s", dev_name(gpu->dev));
 
-	/* Safely take down hangcheck */
-	del_timer_sync(&gpu->hangcheck_timer);
-	cancel_work_sync(&gpu->recover_work);
+	hangcheck_disable(gpu);
 
 	WARN_ON(!list_empty(&gpu->active_list));
 
-- 
2.1.4



More information about the dri-devel mailing list