From 2a79a93c1b9a03a67cceeef90c82f7ca2a5db409 Mon Sep 17 00:00:00 2001 From: Chunyu Fan Date: Tue, 31 Oct 2023 15:16:36 +0800 Subject: [PATCH] Take FPS driver compile error Add check mechanism with kernel version, due to deleting gpio free api with prefix 'devm_' on latest kernel version. Change-Id: Idac00094e9e3d40ed806e95d37881399000a372b Signed-off-by: Chunyu Fan Reviewed-on: https://gerrit.mot.com/2781626 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c | 5 +++++ drivers/input/misc/goodix_fod_mmi/platform.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c b/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c index ec76edff7a28..e93e929674f5 100644 --- a/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c +++ b/drivers/input/misc/fpc_fps_mmi/fpc1020_tee.c @@ -8,6 +8,7 @@ * as published by the Free Software Foundation. */ +#include #include #include #include @@ -28,6 +29,10 @@ #define RESET_HIGH_SLEEP2_MIN_US 5000 #define RESET_HIGH_SLEEP2_MAX_US (RESET_HIGH_SLEEP2_MIN_US + 100) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 25)) +#define devm_gpio_free(a, b) NULL +#endif + struct FPS_data { unsigned int enabled; unsigned int state; diff --git a/drivers/input/misc/goodix_fod_mmi/platform.c b/drivers/input/misc/goodix_fod_mmi/platform.c index 5e1d6b4830d4..6bb245f3f35a 100644 --- a/drivers/input/misc/goodix_fod_mmi/platform.c +++ b/drivers/input/misc/goodix_fod_mmi/platform.c @@ -13,6 +13,7 @@ * GNU General Public License for more details. * */ +#include #include #include #include @@ -30,6 +31,10 @@ #include #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 25)) +#define devm_gpio_free(a, b) NULL +#endif + int gf_parse_dts(struct gf_dev *gf_dev) { int rc = 0; @@ -129,7 +134,9 @@ err_pwr: void gf_cleanup(struct gf_dev *gf_dev) { +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 25)) struct device *dev = &gf_dev->spi->dev; +#endif pr_info("goodix: %s\n", __func__); if (gpio_is_valid(gf_dev->irq_gpio)) {