From 3b4cb5773782eaf261b9213ec4f98b16e2d16fe5 Mon Sep 17 00:00:00 2001 From: Sourav Mohapatra Date: Wed, 6 May 2020 10:11:09 +0530 Subject: [PATCH] qcacmn: Use wakeup_source_register when WAKEUP_SOURCE_DEV is def Currently, the kernel APIs wakeup_source_register are used for kernel version 4.19.110 and higher in sync with the upstream kernel. But in downstream kernel, the same has been introduced from 4.19.80. To accommodate compatibility with both, use a downstream compiler flag to indicate when to use the kernel APIs. Change-Id: I7c2d439aa8c859d92b4bbdbdd5034861c0c98e75 CRs-Fixed: 2679523 --- qdf/linux/src/qdf_lock.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qdf/linux/src/qdf_lock.c b/qdf/linux/src/qdf_lock.c index a953fa0ef1ab..e34340d4aa5d 100644 --- a/qdf/linux/src/qdf_lock.c +++ b/qdf/linux/src/qdf_lock.c @@ -265,7 +265,8 @@ qdf_export_symbol(qdf_wake_lock_name); * QDF status success: if wake lock is initialized * QDF status failure: if wake lock was not initialized */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) || \ + defined(WAKEUP_SOURCE_DEV) QDF_STATUS qdf_wake_lock_create(qdf_wake_lock_t *lock, const char *name) { qdf_mem_zero(lock, sizeof(*lock)); @@ -388,7 +389,8 @@ qdf_export_symbol(qdf_wake_lock_release); * QDF status success: if wake lock is acquired * QDF status failure: if wake lock was not acquired */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) || \ + defined(WAKEUP_SOURCE_DEV) QDF_STATUS qdf_wake_lock_destroy(qdf_wake_lock_t *lock) { wakeup_source_unregister(lock->priv);