From 1600284580a7a95b62f29f02882b13e7d1069d92 Mon Sep 17 00:00:00 2001 From: zhuangnk1 Date: Wed, 25 Oct 2023 13:57:10 +0800 Subject: [PATCH] Change i2c_driver remove function from int to void After Linux kernel version 6.1.0, i2c_driver remove function has no return instead of int. So change it for compatible Change-Id: Ic175cd2201d11c68d681add621886a168ec54a90 Signed-off-by: zhuangnk1 Reviewed-on: https://gerrit.mot.com/2775981 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Tao Sun Reviewed-by: Jun Zhang Submit-Approved: Jira Key --- drivers/nfc/st21nfc/st21nfc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/nfc/st21nfc/st21nfc.c b/drivers/nfc/st21nfc/st21nfc.c index 8b8fb770a7b1..2210d252956e 100644 --- a/drivers/nfc/st21nfc/st21nfc.c +++ b/drivers/nfc/st21nfc/st21nfc.c @@ -983,7 +983,11 @@ err_exit: return ret; } +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE static int st21nfc_remove(struct i2c_client *client) +#else +static void st21nfc_remove(struct i2c_client *client) +#endif { struct st21nfc_dev *st21nfc_dev; @@ -1002,8 +1006,9 @@ static int st21nfc_remove(struct i2c_client *client) kfree(st21nfc_dev->write_buf); kfree(st21nfc_dev->read_buf); kfree(st21nfc_dev); - +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE return 0; +#endif } static int st21nfc_suspend(struct device *device)