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;