diff --git a/Makefile b/Makefile index 47233d10..0ff21532 100644 --- a/Makefile +++ b/Makefile @@ -86,6 +86,9 @@ endif # Changes done in Linux 6.7 onwards ifeq ($(shell test $(LINUX_VERSION) -ge $(LINUX_VERSION_6_7); echo $$?),0) subdir-ccflags-y += -DNV_ASOC_XXX_DROP + +# drm_debugfs_remove_files has root argument +subdir-ccflags-y += -DNV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS endif ifeq ($(CONFIG_TEGRA_VIRTUALIZATION),y) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index df9b9274..e6091681 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -1746,8 +1746,19 @@ static void tegra_dc_early_unregister(struct drm_crtc *crtc) unsigned int count = ARRAY_SIZE(debugfs_files); struct drm_minor *minor = crtc->dev->primary; struct tegra_dc *dc = to_tegra_dc(crtc); +#if defined(NV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS) + struct dentry *root; +#ifdef CONFIG_DEBUG_FS + root = crtc->debugfs_entry; +#else + root = NULL; +#endif + + drm_debugfs_remove_files(dc->debugfs_files, count, root, minor); +#else drm_debugfs_remove_files(dc->debugfs_files, count, minor); +#endif kfree(dc->debugfs_files); dc->debugfs_files = NULL; } diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index b5a06b16..053fd1e9 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -254,9 +254,21 @@ static void tegra_dsi_early_unregister(struct drm_connector *connector) struct tegra_output *output = connector_to_output(connector); unsigned int count = ARRAY_SIZE(debugfs_files); struct tegra_dsi *dsi = to_dsi(output); +#if defined(NV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS) + struct dentry *root; + +#ifdef CONFIG_DEBUG_FS + root = connector->debugfs_entry; +#else + root = NULL; +#endif + drm_debugfs_remove_files(dsi->debugfs_files, count, + root, connector->dev->primary); +#else drm_debugfs_remove_files(dsi->debugfs_files, count, connector->dev->primary); +#endif kfree(dsi->debugfs_files); dsi->debugfs_files = NULL; } diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index 4cb37b18..4c8cf116 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -1121,8 +1121,19 @@ static void tegra_hdmi_early_unregister(struct drm_connector *connector) struct drm_minor *minor = connector->dev->primary; unsigned int count = ARRAY_SIZE(debugfs_files); struct tegra_hdmi *hdmi = to_hdmi(output); +#if defined(NV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS) + struct dentry *root; +#ifdef CONFIG_DEBUG_FS + root = connector->debugfs_entry; +#else + root = NULL; +#endif + + drm_debugfs_remove_files(hdmi->debugfs_files, count, root, minor); +#else drm_debugfs_remove_files(hdmi->debugfs_files, count, minor); +#endif kfree(hdmi->debugfs_files); hdmi->debugfs_files = NULL; } diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 629db1c4..890d915c 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -1717,9 +1717,22 @@ static void tegra_sor_early_unregister(struct drm_connector *connector) struct tegra_output *output = connector_to_output(connector); unsigned int count = ARRAY_SIZE(debugfs_files); struct tegra_sor *sor = to_sor(output); +#if defined(NV_DRM_DEBUGFS_REMOVE_HAS_ROOT_ARGS) + struct dentry *root; + +#ifdef CONFIG_DEBUG_FS + root = connector->debugfs_entry; +#else + root = NULL; +#endif + + drm_debugfs_remove_files(sor->debugfs_files, count, + root, connector->dev->primary); +#else drm_debugfs_remove_files(sor->debugfs_files, count, connector->dev->primary); +#endif kfree(sor->debugfs_files); sor->debugfs_files = NULL; }