From 5bd625523970c9c7b3941856bf174c998ed097f8 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Mon, 9 Jan 2023 21:05:48 +0000 Subject: [PATCH] tegra: hwpm: 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 HWPM driver with Linux v6.2. Make the necessary changes to the HWPM driver to fix the build breakage. Bug 3936429 Signed-off-by: Jon Hunter Change-Id: I54b7bcefbd5a2e6e88c13b3714ea012cc2a73615 (cherry picked from commit de9dd40f6a4dc35e6ee9e6140cac148171bcd6e1) Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2847008 Tested-by: Vedashree Vidwans Reviewed-by: Vedashree Vidwans Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit --- drivers/tegra/hwpm/os/linux/driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tegra/hwpm/os/linux/driver.c b/drivers/tegra/hwpm/os/linux/driver.c index 7f08e36..0d20054 100644 --- a/drivers/tegra/hwpm/os/linux/driver.c +++ b/drivers/tegra/hwpm/os/linux/driver.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -46,7 +47,11 @@ static const struct of_device_id tegra_soc_hwpm_of_match[] = { }; MODULE_DEVICE_TABLE(of, tegra_soc_hwpm_of_match); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)) static char *tegra_hwpm_get_devnode(struct device *dev, umode_t *mode) +#else +static char *tegra_hwpm_get_devnode(const struct device *dev, umode_t *mode) +#endif { if (!mode) { return NULL;