From dc420b6a6d45da01a4ff3e62527581e16ed2a915 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Fri, 2 Dec 2022 13:20:17 +0000 Subject: [PATCH] video: camera: Fix rtcpu build for Linux v5.14 The RTCPU driver fails to build with Linux v5.14 as an out-of-tree module because the return type of the bus_type remove callback is int and not void. Make the necessary changes to allow the RTCPU driver to build for Linux v5.14+ kernels. Bug 3820317 Change-Id: I127d9ff2ae12901f85374e3e8feabc77e0d17407 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2820711 Reviewed-by: Matti Ryttylainen Reviewed-by: Bibek Basu GVS: Gerrit_Virtual_Submit --- drivers/platform/tegra/rtcpu/ivc-bus.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/platform/tegra/rtcpu/ivc-bus.c b/drivers/platform/tegra/rtcpu/ivc-bus.c index 8fc530e3..5602bd52 100644 --- a/drivers/platform/tegra/rtcpu/ivc-bus.c +++ b/drivers/platform/tegra/rtcpu/ivc-bus.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "soc/tegra/camrtc-channels.h" #include "soc/tegra/camrtc-commands.h" @@ -390,7 +391,11 @@ static int tegra_ivc_bus_probe(struct device *dev) return ret; } +#if (KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE) static void tegra_ivc_bus_remove(struct device *dev) +#else +static int tegra_ivc_bus_remove(struct device *dev) +#endif { if (dev->type == &tegra_ivc_channel_type) { struct tegra_ivc_driver *drv = to_tegra_ivc_driver(dev->driver); @@ -406,7 +411,9 @@ static void tegra_ivc_bus_remove(struct device *dev) } - return; +#if (KERNEL_VERSION(5, 15, 0) > LINUX_VERSION_CODE) + return 0; +#endif } static int tegra_ivc_bus_ready_child(struct device *dev, void *data)