]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: tegra: Allow building as a module
authorAaron Kling <webgeek1234@gmail.com>
Thu, 31 Jul 2025 21:59:26 +0000 (16:59 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 26 Dec 2025 16:57:17 +0000 (10:57 -0600)
Change the module macro back to builtin, which does not define an exit
function. This will prevent the module from being unloaded. There are
concerns with modules not cleaning up IRQs on unload, thus unload must be
specifically disallowed. Drop the remove callback as it is unused.

Signed-off-by: Aaron Kling <webgeek1234@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20250731-pci-tegra-module-v7-3-cad4b088b8fb@gmail.com
drivers/pci/controller/Kconfig
drivers/pci/controller/pci-tegra.c

index c254d2b8bf17b02aeea2e3a30db2ebe1c12f5fb1..f1621f87f05b73435a9fc7fe6cd09eb3095df0a4 100644 (file)
@@ -232,7 +232,7 @@ config PCI_HYPERV_INTERFACE
          driver.
 
 config PCI_TEGRA
-       bool "NVIDIA Tegra PCIe controller"
+       tristate "NVIDIA Tegra PCIe controller"
        depends on ARCH_TEGRA || COMPILE_TEST
        depends on PCI_MSI
        select IRQ_MSI_LIB
index 942ddfca3bf6b7c1a0621e6caa59e2a29e8a5393..512309763d1fbf639c8e574fa2ca0d07a04a4c26 100644 (file)
@@ -2545,12 +2545,6 @@ static const struct seq_operations tegra_pcie_ports_sops = {
 
 DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports);
 
-static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie)
-{
-       debugfs_remove_recursive(pcie->debugfs);
-       pcie->debugfs = NULL;
-}
-
 static void tegra_pcie_debugfs_init(struct tegra_pcie *pcie)
 {
        pcie->debugfs = debugfs_create_dir("pcie", NULL);
@@ -2624,29 +2618,6 @@ put_resources:
        return err;
 }
 
-static void tegra_pcie_remove(struct platform_device *pdev)
-{
-       struct tegra_pcie *pcie = platform_get_drvdata(pdev);
-       struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
-       struct tegra_pcie_port *port, *tmp;
-
-       if (IS_ENABLED(CONFIG_DEBUG_FS))
-               tegra_pcie_debugfs_exit(pcie);
-
-       pci_stop_root_bus(host->bus);
-       pci_remove_root_bus(host->bus);
-       pm_runtime_put_sync(pcie->dev);
-       pm_runtime_disable(pcie->dev);
-
-       if (IS_ENABLED(CONFIG_PCI_MSI))
-               tegra_pcie_msi_teardown(pcie);
-
-       tegra_pcie_put_resources(pcie);
-
-       list_for_each_entry_safe(port, tmp, &pcie->ports, list)
-               tegra_pcie_port_free(port);
-}
-
 static int tegra_pcie_pm_suspend(struct device *dev)
 {
        struct tegra_pcie *pcie = dev_get_drvdata(dev);
@@ -2750,6 +2721,8 @@ static struct platform_driver tegra_pcie_driver = {
                .pm = &tegra_pcie_pm_ops,
        },
        .probe = tegra_pcie_probe,
-       .remove = tegra_pcie_remove,
 };
-module_platform_driver(tegra_pcie_driver);
+builtin_platform_driver(tegra_pcie_driver);
+MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
+MODULE_DESCRIPTION("NVIDIA PCI host controller driver");
+MODULE_LICENSE("GPL");