From c85603d008eefc61f144fde55a92791475cbf676 Mon Sep 17 00:00:00 2001 From: Rajesh Chauhan Date: Wed, 21 Sep 2022 23:11:54 -0700 Subject: [PATCH] qcacmn: replace complete_and_exit with kthread_complete_and_exit In kernel 5.17, complete_and_exit is replaced with kthread_complete_and_exit. So if kernel version is >= 5.17, then use kthread_complete_and_exit. Change-Id: I4e9a98373197eba4931a8dafe77040448ffb40eb CRs-Fixed: 3297481 --- hif/src/sdio/transfer/mailbox.c | 12 +++++++++++- utils/logging/src/wlan_logging_sock_svc.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/hif/src/sdio/transfer/mailbox.c b/hif/src/sdio/transfer/mailbox.c index 9ec30ce263..80b7040014 100644 --- a/hif/src/sdio/transfer/mailbox.c +++ b/hif/src/sdio/transfer/mailbox.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -44,6 +45,15 @@ #include "regtable.h" #include "transfer.h" +/* + * The following commit was introduced in v5.17: + * cead18552660 ("exit: Rename complete_and_exit to kthread_complete_and_exit") + * Use the old name for kernels before 5.17 + */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)) +#define kthread_complete_and_exit(c, s) complete_and_exit(c, s) +#endif + /* by default setup a bounce buffer for the data packets, * if the underlying host controller driver * does not use DMA you may be able to skip this step @@ -1887,7 +1897,7 @@ static int async_task(void *param) } } - complete_and_exit(&device->async_completion, 0); + kthread_complete_and_exit(&device->async_completion, 0); return 0; } diff --git a/utils/logging/src/wlan_logging_sock_svc.c b/utils/logging/src/wlan_logging_sock_svc.c index 58f5782c19..df3b41681d 100644 --- a/utils/logging/src/wlan_logging_sock_svc.c +++ b/utils/logging/src/wlan_logging_sock_svc.c @@ -64,6 +64,15 @@ #include #endif +/* + * The following commit was introduced in v5.17: + * cead18552660 ("exit: Rename complete_and_exit to kthread_complete_and_exit") + * Use the old name for kernels before 5.17 + */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)) +#define kthread_complete_and_exit(c, s) complete_and_exit(c, s) +#endif + #define MAX_NUM_PKT_LOG 32 #define LOGGING_TRACE(level, args ...) \ @@ -923,7 +932,7 @@ static int wlan_logging_thread(void *Arg) &gwlan_logging.eventFlag); } - complete_and_exit(&gwlan_logging.shutdown_comp, 0); + kthread_complete_and_exit(&gwlan_logging.shutdown_comp, 0); return 0; }