From e49269929e50770326f575de06a6e3e7d6fea1a5 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Tue, 19 Dec 2023 08:23:06 +0000 Subject: [PATCH] media: ar1335: Use conftest to determine remove return type Use conftest to determine the return type of .remove() of struct i2c_driver is int or void type instead of kernel version. The return type got changed with commit ed5c2f5fd10d ("i2c: Make remove callback return void") Bug 4387902 Change-Id: Iceb50b0c9cd78fefb35aef0831b1ea7e8f74d619 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3037915 GVS: Gerrit_Virtual_Submit --- drivers/media/i2c/ar1335_common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/i2c/ar1335_common.c b/drivers/media/i2c/ar1335_common.c index 8fa7d9cb..a742836f 100644 --- a/drivers/media/i2c/ar1335_common.c +++ b/drivers/media/i2c/ar1335_common.c @@ -2822,7 +2822,7 @@ static void cam_remove(struct i2c_client *client) if (pwdn_gpio < 0) { dev_err(&client->dev, "Unable to get power GPIO\n"); gpio_free(reset_gpio); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -2833,7 +2833,7 @@ static void cam_remove(struct i2c_client *client) gpio_free(pwdn_gpio); if (!priv || !priv->pdata) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -1; #else return; @@ -2876,7 +2876,7 @@ static void cam_remove(struct i2c_client *client) FREE_SAFE(&client->dev, priv->s_data); FREE_SAFE(&client->dev, priv); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #else return;