msm: pil-riva: Flush instead of cancel delayed work on removal
If the pil riva driver is removed or fails to probe we want to
ensure that the proxy votes made during boot are removed even if
they're pending removal. cancel_delayed_work_sync() will ensure
that the proxy vote removal callback no longer runs, but it
doesn't force the callback to run. This means that the proxy
votes stay in place even though the driver has been detached.
Therefore, replace cancel_delayed_work_sync() with
flush_delayed_work_sync() to forcibly remove the proxy votes
before detaching the driver.
Change-Id: Ia09fe2a6eb76e69d410f95ea4c28d78ff75727ff
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/arch/arm/mach-msm/pil-riva.c b/arch/arm/mach-msm/pil-riva.c
index 7e78a15..a647fae 100644
--- a/arch/arm/mach-msm/pil-riva.c
+++ b/arch/arm/mach-msm/pil-riva.c
@@ -390,7 +390,7 @@
goto err_register;
return 0;
err_register:
- cancel_delayed_work_sync(&drv->work);
+ flush_delayed_work_sync(&drv->work);
clk_put(drv->xo);
err:
regulator_put(drv->pll_supply);
@@ -400,7 +400,7 @@
static int __devexit pil_riva_remove(struct platform_device *pdev)
{
struct riva_data *drv = platform_get_drvdata(pdev);
- cancel_delayed_work_sync(&drv->work);
+ flush_delayed_work_sync(&drv->work);
clk_put(drv->xo);
regulator_put(drv->pll_supply);
return 0;