From 39689b540fb8104b493aee37fbe616f174451ca4 Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Sun, 2 Oct 2022 13:48:25 +0800 Subject: [PATCH] input: ili9882_mmi: don't use kernel_read/write for 5.10 ili9882_mmi: Don't use kernel_read/kernel_write for 5.10 kernel. Use apk for factory test, so delete these functions are OK. Change-Id: Ifccbb1dd37feec063affa0183c71fcdd427a700b Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/2396131 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Reviewed-by: Jing Hu Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- .../input/touchscreen/ili9882_mmi/ili9882_flash.c | 12 ++++++------ .../input/touchscreen/ili9882_mmi/ili9882_hostdl.c | 7 ++++--- drivers/input/touchscreen/ili9882_mmi/ili9882_mp.c | 6 +++--- drivers/input/touchscreen/ili9882_mmi/ili9882_node.c | 6 +++--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_flash.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_flash.c index b877e9713c81..c81907c950c7 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_flash.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_flash.c @@ -179,14 +179,14 @@ int ili_fw_dump_iram_data(u32 start, u32 end, bool save) } pos = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) - kernel_write(f, fw_buf, len, &pos); -#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) old_fs = get_fs(); set_fs(get_ds()); set_fs(KERNEL_DS); vfs_write(f, fw_buf, len, &pos); set_fs(old_fs); +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) + kernel_write(f, fw_buf, len, &pos); #endif filp_close(f, NULL); ILI_INFO("Save iram data to %s\n", DUMP_IRAM_PATH); @@ -540,14 +540,14 @@ int ili_fw_dump_flash_data(u32 start, u32 end, bool user) goto out; pos = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) - kernel_write(f, buf, length, &pos); -#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) old_fs = get_fs(); set_fs(get_ds()); set_fs(KERNEL_DS); vfs_write(f, buf, length, &pos); set_fs(old_fs); +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) + kernel_write(f, buf, length, &pos); #endif filp_close(f, NULL); ipio_vfree((void **)&buf); diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_hostdl.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_hostdl.c index 280993ebe96d..f5a47120a9a2 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_hostdl.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_hostdl.c @@ -239,14 +239,15 @@ int ili_fw_dump_iram_data(u32 start, u32 end, bool save) } pos = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) - kernel_write(f, ilits->update_buf, len, &pos); -#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) old_fs = get_fs(); set_fs(get_ds()); set_fs(KERNEL_DS); vfs_write(f, ilits->update_buf, len, &pos); set_fs(old_fs); + +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) + kernel_write(f, ilits->update_buf, len, &pos); #endif filp_close(f, NULL); ILI_INFO("Save iram data to %s\n", DUMP_IRAM_PATH); diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_mp.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_mp.c index bfdb6d8bd302..327f02e5bb5a 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_mp.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_mp.c @@ -3324,13 +3324,13 @@ static int mp_show_result(bool lcm_on) } pos = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) - kernel_write(f, csv, csv_len, &pos); -#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) fs = get_fs(); set_fs(KERNEL_DS); vfs_write(f, csv, csv_len, &pos); set_fs(fs); +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) + kernel_write(f, csv, csv_len, &pos); #endif filp_close(f, NULL); diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c index 5cced0d431ad..36e68ab5e6f4 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c @@ -224,13 +224,13 @@ static int file_write(struct file_buffer *file, bool new_open) return -1; } pos = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) - kernel_write(f, file->ptr, file->wlen, &pos); -#else +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) fs = get_fs(); set_fs(KERNEL_DS); vfs_write(f, file->ptr, file->flen, &pos); set_fs(fs); +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) + kernel_write(f, file->ptr, file->wlen, &pos); #endif filp_close(f, NULL); return 0;