diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile index 2f43ff1e..a81246a1 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -1,15 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only # SPDX-FileCopyrightText: Copyright (c) 2022-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL)) -LINUX_VERSION_6_11 := $(shell expr 6 \* 256 + 11) - # MODS is currently broken for Linux v6.11 and later -ifeq ($(shell test $(LINUX_VERSION) -lt $(LINUX_VERSION_6_11); echo $$?),0) ifndef CONFIG_TEGRA_SYSTEM_TYPE_ACK obj-m += mods/ endif -endif obj-m += nvsciipc/ ifdef CONFIG_PCI obj-m += tegra-pcie-dma-test.o diff --git a/drivers/misc/mods/mods_dma.c b/drivers/misc/mods/mods_dma.c index 744cf2c4..46c6c4ca 100644 --- a/drivers/misc/mods/mods_dma.c +++ b/drivers/misc/mods/mods_dma.c @@ -516,12 +516,20 @@ static int tegra_dma_driver_probe(struct platform_device *pdev) return 0; } +#if KERNEL_VERSION(6, 11, 0) <= MODS_KERNEL_VERSION +static void tegra_dma_driver_remove(struct platform_device *pdev) +{ + put_device(&pdev->dev); + mods_tegra_dma_dev = NULL; +} +#else static int tegra_dma_driver_remove(struct platform_device *pdev) { put_device(&pdev->dev); mods_tegra_dma_dev = NULL; return 0; } +#endif static const struct of_device_id of_ids[] = { { .compatible = "nvidia,mods_tegra_dma" }, diff --git a/drivers/misc/mods/mods_dmabuf.c b/drivers/misc/mods/mods_dmabuf.c index 58fab6b9..46e03d06 100644 --- a/drivers/misc/mods/mods_dmabuf.c +++ b/drivers/misc/mods/mods_dmabuf.c @@ -114,11 +114,6 @@ static int mods_dmabuf_probe(struct platform_device *pdev) return 0; } -static int mods_dmabuf_remove(struct platform_device *pdev) -{ - return 0; -} - static const struct of_device_id of_ids[] = { { .compatible = "nvidia,mods_test" }, { } @@ -126,7 +121,6 @@ static const struct of_device_id of_ids[] = { static struct platform_driver mods_dummy_driver = { .probe = mods_dmabuf_probe, - .remove = mods_dmabuf_remove, .driver = { .name = "nvidia_mods_dummy_driver", .owner = THIS_MODULE, diff --git a/drivers/misc/mods/mods_smmu_drv.c b/drivers/misc/mods/mods_smmu_drv.c index 08ef2c29..48705c75 100644 --- a/drivers/misc/mods/mods_smmu_drv.c +++ b/drivers/misc/mods/mods_smmu_drv.c @@ -98,11 +98,18 @@ static int mods_smmu_driver_probe(struct platform_device *pdev) return err; } +#if KERNEL_VERSION(6, 11, 0) <= MODS_KERNEL_VERSION +static void mods_smmu_driver_remove(struct platform_device *pdev) +{ + mods_smmu_dev_num = 0; +} +#else static int mods_smmu_driver_remove(struct platform_device *pdev) { mods_smmu_dev_num = 0; return 0; } +#endif static const struct of_device_id of_ids[] = { { .compatible = "nvidia,mods_smmu" },