Skip to content

Commit aac5ba6

Browse files
webgeek1234bjorn-helgaas
authored andcommitted
PCI: tegra: Allow building as a module
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
1 parent eefff3d commit aac5ba6

2 files changed

Lines changed: 5 additions & 32 deletions

File tree

drivers/pci/controller/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ config PCI_HYPERV_INTERFACE
232232
driver.
233233

234234
config PCI_TEGRA
235-
bool "NVIDIA Tegra PCIe controller"
235+
tristate "NVIDIA Tegra PCIe controller"
236236
depends on ARCH_TEGRA || COMPILE_TEST
237237
depends on PCI_MSI
238238
select IRQ_MSI_LIB

drivers/pci/controller/pci-tegra.c

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,12 +2545,6 @@ static const struct seq_operations tegra_pcie_ports_sops = {
25452545

25462546
DEFINE_SEQ_ATTRIBUTE(tegra_pcie_ports);
25472547

2548-
static void tegra_pcie_debugfs_exit(struct tegra_pcie *pcie)
2549-
{
2550-
debugfs_remove_recursive(pcie->debugfs);
2551-
pcie->debugfs = NULL;
2552-
}
2553-
25542548
static void tegra_pcie_debugfs_init(struct tegra_pcie *pcie)
25552549
{
25562550
pcie->debugfs = debugfs_create_dir("pcie", NULL);
@@ -2624,29 +2618,6 @@ static int tegra_pcie_probe(struct platform_device *pdev)
26242618
return err;
26252619
}
26262620

2627-
static void tegra_pcie_remove(struct platform_device *pdev)
2628-
{
2629-
struct tegra_pcie *pcie = platform_get_drvdata(pdev);
2630-
struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
2631-
struct tegra_pcie_port *port, *tmp;
2632-
2633-
if (IS_ENABLED(CONFIG_DEBUG_FS))
2634-
tegra_pcie_debugfs_exit(pcie);
2635-
2636-
pci_stop_root_bus(host->bus);
2637-
pci_remove_root_bus(host->bus);
2638-
pm_runtime_put_sync(pcie->dev);
2639-
pm_runtime_disable(pcie->dev);
2640-
2641-
if (IS_ENABLED(CONFIG_PCI_MSI))
2642-
tegra_pcie_msi_teardown(pcie);
2643-
2644-
tegra_pcie_put_resources(pcie);
2645-
2646-
list_for_each_entry_safe(port, tmp, &pcie->ports, list)
2647-
tegra_pcie_port_free(port);
2648-
}
2649-
26502621
static int tegra_pcie_pm_suspend(struct device *dev)
26512622
{
26522623
struct tegra_pcie *pcie = dev_get_drvdata(dev);
@@ -2750,6 +2721,8 @@ static struct platform_driver tegra_pcie_driver = {
27502721
.pm = &tegra_pcie_pm_ops,
27512722
},
27522723
.probe = tegra_pcie_probe,
2753-
.remove = tegra_pcie_remove,
27542724
};
2755-
module_platform_driver(tegra_pcie_driver);
2725+
builtin_platform_driver(tegra_pcie_driver);
2726+
MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
2727+
MODULE_DESCRIPTION("NVIDIA PCI host controller driver");
2728+
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)