From c515a569268cf430a3639ef95262dbdb6f7e8f3f Mon Sep 17 00:00:00 2001 From: Gilberto Gambugge Date: Sun, 16 Aug 2020 10:35:09 -0300 Subject: [PATCH] aw8624: 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: I2a32c95ef6194ccba6704e0f90e0a609610fd445 Reviewed-on: https://gerrit.mot.com/1725210 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ling Jin Submit-Approved: Jira Key --- drivers/misc/awinic/aw8624/aw8624.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/misc/awinic/aw8624/aw8624.c b/drivers/misc/awinic/aw8624/aw8624.c index e96b1da4c7e8..408c582eb28e 100644 --- a/drivers/misc/awinic/aw8624/aw8624.c +++ b/drivers/misc/awinic/aw8624/aw8624.c @@ -3999,7 +3999,12 @@ aw8624_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) g_aw8624 = aw8624; +#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))) + aw8624->ws = wakeup_source_register(aw8624->dev, "vibrator"); +#else aw8624->ws = wakeup_source_register("vibrator"); +#endif if (!aw8624->ws) return -ENOMEM; aw8624_vibrator_init(aw8624);