From ee4413e974d0832a96bd2c3029765dc19a2a7b16 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 9 Jan 2023 20:47:17 +0000 Subject: [PATCH] gpu: host1x-fence: Fix build for Linux v6.2 Upstream Linux kernel commit ff62b8e6588f ("driver core: make struct class.devnode() take a const *") updated the 'devnode' function pointer under the class structure to take a const device struct. This breaks building the Tegra host1x-fence driver with Linux v6.2. Make the necessary changes to the host1x-fence driver to fix the build breakage. Bug 3936429 Signed-off-by: Jon Hunter Change-Id: Ia7abb62424c9532342a16ca7b5e8470e96b91d25 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2841034 Reviewed-by: Laxman Dewangan GVS: Gerrit_Virtual_Submit --- drivers/gpu/host1x-fence/dev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/host1x-fence/dev.c b/drivers/gpu/host1x-fence/dev.c index 2861a76c..47807553 100644 --- a/drivers/gpu/host1x-fence/dev.c +++ b/drivers/gpu/host1x-fence/dev.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "include/uapi/linux/host1x-fence.h" @@ -407,7 +408,11 @@ static const struct file_operations dev_file_fops = { .compat_ioctl = dev_file_ioctl, }; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)) static char *host1x_fence_devnode(struct device *dev, umode_t *mode) +#else +static char *host1x_fence_devnode(const struct device *dev, umode_t *mode) +#endif { *mode = 0666; return NULL;