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 <jonathanh@nvidia.com>
Change-Id: I54b7bcefbd5a2e6e88c13b3714ea012cc2a73615
(cherry picked from commit de9dd40f6a4dc35e6ee9e6140cac148171bcd6e1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2847008
Tested-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-01-09 21:05:48 +00:00
committed by mobile promotions
parent f010cf5956
commit 5bd6255239

View File

@@ -18,6 +18,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/dma-buf.h> #include <linux/dma-buf.h>
#include <linux/debugfs.h> #include <linux/debugfs.h>
#include <linux/version.h>
#include <tegra_hwpm.h> #include <tegra_hwpm.h>
#include <tegra_hwpm_ip.h> #include <tegra_hwpm_ip.h>
@@ -46,7 +47,11 @@ static const struct of_device_id tegra_soc_hwpm_of_match[] = {
}; };
MODULE_DEVICE_TABLE(of, 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) 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) { if (!mode) {
return NULL; return NULL;