From bffb70175c65db2dd14fb567a0b5beabc798092c Mon Sep 17 00:00:00 2001 From: Gilberto Gambugge Date: Sun, 16 Aug 2020 10:36:03 -0300 Subject: [PATCH] nt36xxx: Fix build error due to wakeup API changes On latest 4.14 kernel update, wakeup_source_register API has changed. Handle kernel versions properly. NO_PROP_NEEDED: Change-Id: I57a38470f79e29b406ec578b52f624f1bf39beae Reviewed-on: https://gerrit.mot.com/1725211 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ling Jin Submit-Approved: Jira Key --- drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c index 45e8c7439010..45b8ac485e67 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c +++ b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c @@ -2011,7 +2011,8 @@ static int32_t nvt_ts_probe(struct spi_device *client) #ifdef CONFIG_HAS_WAKELOCK wake_lock_init(&gesture_wakelock, WAKE_LOCK_SUSPEND, "dt-wake-lock"); #else -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) +#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 110)) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 163) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0))) gesture_wakelock = wakeup_source_register(&client->dev, "dt-wake-lock"); #else gesture_wakelock = wakeup_source_register("dt-wake-lock");