From 891c93a8fbcb3b3de0216ef6c285bd2f4b98130f Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Fri, 9 Dec 2022 12:14:50 +0000 Subject: [PATCH] media: Fix build for Linux v6.1 Upstream Linux commit ed5c2f5fd10d ("i2c: Make remove callback return void") in Linux v6.1, updates the i2c remove callback to prototype to return void instead of int. This is causes the build for CDI and ISC drivers to fail for Linux v6.1. Update these drivers to fix the build for Linux v6.1. Bug 3820317 Bug 3835208 Change-Id: Id71db032896c437017cf2ffa3216353b8472cd6d Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2825008 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/media/platform/tegra/cdi/cdi_dev.c | 7 +++++++ drivers/media/platform/tegra/isc/isc_dev.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/media/platform/tegra/cdi/cdi_dev.c b/drivers/media/platform/tegra/cdi/cdi_dev.c index 715638cb..dcba0587 100644 --- a/drivers/media/platform/tegra/cdi/cdi_dev.c +++ b/drivers/media/platform/tegra/cdi/cdi_dev.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -797,7 +798,11 @@ static int cdi_dev_probe(struct i2c_client *client, return 0; } +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE static int cdi_dev_remove(struct i2c_client *client) +#else +static void cdi_dev_remove(struct i2c_client *client) +#endif { struct cdi_dev_info *info = i2c_get_clientdata(client); struct device *pdev; @@ -814,7 +819,9 @@ static int cdi_dev_remove(struct i2c_client *client) if (info->cdev.dev) cdev_del(&info->cdev); +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE return 0; +#endif } #ifdef CONFIG_PM diff --git a/drivers/media/platform/tegra/isc/isc_dev.c b/drivers/media/platform/tegra/isc/isc_dev.c index eb4215d4..7f451363 100644 --- a/drivers/media/platform/tegra/isc/isc_dev.c +++ b/drivers/media/platform/tegra/isc/isc_dev.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -507,7 +508,11 @@ static int isc_dev_probe(struct i2c_client *client, return 0; } +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE static int isc_dev_remove(struct i2c_client *client) +#else +static void isc_dev_remove(struct i2c_client *client) +#endif { struct isc_dev_info *info = i2c_get_clientdata(client); struct device *pdev; @@ -524,7 +529,9 @@ static int isc_dev_remove(struct i2c_client *client) if (info->cdev.dev) cdev_del(&info->cdev); +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE return 0; +#endif } #ifdef CONFIG_PM