misc: cec: cancel workqueue in suspend
Deepak Nibade [Mon, 30 Sep 2013 06:13:59 +0000 (11:13 +0530)]
- cancel the workqueue in suspend method before turning
  off the clock

Bug 1360341

Change-Id: I126da686a6ba0c5eec55b67df1e9f962ce16fc48
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/280159
(cherry picked from commit 7cc6da6e41c7889f7ed8da7833d293b3b884bc0e)
Reviewed-on: http://git-master/r/353591
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

drivers/misc/tegra-cec/tegra_cec.c

index e125aa1..2490f3e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * drivers/misc/tegra-cec/tegra_cec.c
  *
- * Copyright (c) 2012-2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -378,12 +378,8 @@ static int tegra_cec_suspend(struct platform_device *pdev, pm_message_t state)
 {
        struct tegra_cec *cec = platform_get_drvdata(pdev);
 
-       /* defer suspend if init is still in progress */
-       if (cec->init_done == 0) {
-               dev_err(&pdev->dev,
-                               "Init still in progress. Aborting suspend\n");
-               return -EBUSY;
-       }
+       /* cancel the work queue */
+       cancel_work_sync(&cec->work);
 
        clk_disable(cec->clk);