From f9cbd12ed7051fb82e0e584947a6eb8f3dcbf7cf Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Thu, 12 Jan 2017 12:28:08 -0800 Subject: [PATCH] ANDROID: fiq_debugger: Remove wakelock.h dependencies Change-Id: I16a0dd4c4c6ee6440ce8a921bc0834d904b81f37 Signed-off-by: Dmitry Shmidt --- .../staging/android/fiq_debugger/fiq_debugger.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/android/fiq_debugger/fiq_debugger.c b/drivers/staging/android/fiq_debugger/fiq_debugger.c index 098078f55395..f6a806219f84 100644 --- a/drivers/staging/android/fiq_debugger/fiq_debugger.c +++ b/drivers/staging/android/fiq_debugger/fiq_debugger.c @@ -33,7 +33,6 @@ #include #include #include -#include #ifdef CONFIG_FIQ_GLUE #include @@ -82,7 +81,7 @@ struct fiq_debugger_state { struct timer_list sleep_timer; spinlock_t sleep_timer_lock; bool uart_enabled; - struct wake_lock debugger_wake_lock; + struct wakeup_source debugger_wake_src; bool console_enable; int current_cpu; atomic_t unhandled_fiq_count; @@ -563,7 +562,7 @@ static void fiq_debugger_sleep_timer_expired(unsigned long data) state->uart_enabled = false; fiq_debugger_enable_wakeup_irq(state); } - wake_unlock(&state->debugger_wake_lock); + __pm_relax(&state->debugger_wake_src); spin_unlock_irqrestore(&state->sleep_timer_lock, flags); } @@ -575,7 +574,7 @@ static void fiq_debugger_handle_wakeup(struct fiq_debugger_state *state) if (state->wakeup_irq >= 0 && state->ignore_next_wakeup_irq) { state->ignore_next_wakeup_irq = false; } else if (!state->uart_enabled) { - wake_lock(&state->debugger_wake_lock); + __pm_stay_awake(&state->debugger_wake_src); fiq_debugger_uart_enable(state); state->uart_enabled = true; fiq_debugger_disable_wakeup_irq(state); @@ -619,7 +618,7 @@ static void fiq_debugger_handle_irq_context(struct fiq_debugger_state *state) unsigned long flags; spin_lock_irqsave(&state->sleep_timer_lock, flags); - wake_lock(&state->debugger_wake_lock); + __pm_stay_awake(&state->debugger_wake_src); mod_timer(&state->sleep_timer, jiffies + HZ * 5); spin_unlock_irqrestore(&state->sleep_timer_lock, flags); } @@ -1086,8 +1085,7 @@ static int fiq_debugger_probe(struct platform_device *pdev) state->no_sleep = true; state->ignore_next_wakeup_irq = !state->no_sleep; - wake_lock_init(&state->debugger_wake_lock, - WAKE_LOCK_SUSPEND, "serial-debug"); + wakeup_source_init(&state->debugger_wake_src, "serial-debug"); state->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(state->clk)) @@ -1188,7 +1186,7 @@ err_uart_init: clk_disable(state->clk); if (state->clk) clk_put(state->clk); - wake_lock_destroy(&state->debugger_wake_lock); + wakeup_source_trash(&state->debugger_wake_src); platform_set_drvdata(pdev, NULL); kfree(state); return ret; -- 2.20.1