dsp: usf: update wakeup_source API

wakeup_source_init and wakeup_source_trash are removed in new kernel.
Update the two APIs to wakeup_source_register and wakeup_source_unregister.

Change-Id: I1e0b6e856dc2636032da68bf0e3d2be215d3ae8e
Signed-off-by: Dechen Chai <dchai@codeaurora.org>
This commit is contained in:
Dechen Chai 2021-06-24 17:59:55 +05:30
parent b698fda5c7
commit 578282f10d

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
* Copyright (c) 2011-2017, 2021, The Linux Foundation. All rights reserved.
*/
#include <linux/compat.h>
@ -173,7 +173,7 @@ static const int s_button_map[] = {
/* The opened devices container */
static atomic_t s_opened_devs[MAX_DEVS_NUMBER];
static struct wakeup_source usf_wakeup_source;
static struct wakeup_source *usf_wakeup_source;
#define USF_NAME_PREFIX "usf_"
#define USF_NAME_PREFIX_SIZE 4
@ -442,7 +442,7 @@ static void usf_tx_cb(uint32_t opcode, uint32_t token,
case Q6USM_EVENT_READ_DONE:
pr_debug("%s: acquiring %d msec wake lock\n", __func__,
STAY_AWAKE_AFTER_READ_MSECS);
__pm_wakeup_event(&usf_wakeup_source,
__pm_wakeup_event(usf_wakeup_source,
STAY_AWAKE_AFTER_READ_MSECS);
if (token == USM_WRONG_TOKEN)
usf_xx->usf_state = USF_ERROR_STATE;
@ -2370,7 +2370,7 @@ static int usf_open(struct inode *inode, struct file *file)
if (usf == NULL)
return -ENOMEM;
wakeup_source_init(&usf_wakeup_source, "usf");
usf_wakeup_source = wakeup_source_register(NULL, "usf");
file->private_data = usf;
usf->dev_ind = dev_ind;
@ -2401,7 +2401,7 @@ static int usf_release(struct inode *inode, struct file *file)
atomic_set(&s_opened_devs[usf->dev_ind], 0);
wakeup_source_trash(&usf_wakeup_source);
wakeup_source_unregister(usf_wakeup_source);
mutex_unlock(&usf->mutex);
mutex_destroy(&usf->mutex);
kfree(usf);