Skip to content

Commit c7fd95c

Browse files
Uwe Kleine-Königkwilczynski
authored andcommitted
PCI: tegra: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent 2998efc commit c7fd95c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/pci-tegra.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2680,7 +2680,7 @@ static int tegra_pcie_probe(struct platform_device *pdev)
26802680
return err;
26812681
}
26822682

2683-
static int tegra_pcie_remove(struct platform_device *pdev)
2683+
static void tegra_pcie_remove(struct platform_device *pdev)
26842684
{
26852685
struct tegra_pcie *pcie = platform_get_drvdata(pdev);
26862686
struct pci_host_bridge *host = pci_host_bridge_from_priv(pcie);
@@ -2701,8 +2701,6 @@ static int tegra_pcie_remove(struct platform_device *pdev)
27012701

27022702
list_for_each_entry_safe(port, tmp, &pcie->ports, list)
27032703
tegra_pcie_port_free(port);
2704-
2705-
return 0;
27062704
}
27072705

27082706
static int tegra_pcie_pm_suspend(struct device *dev)
@@ -2808,6 +2806,6 @@ static struct platform_driver tegra_pcie_driver = {
28082806
.pm = &tegra_pcie_pm_ops,
28092807
},
28102808
.probe = tegra_pcie_probe,
2811-
.remove = tegra_pcie_remove,
2809+
.remove_new = tegra_pcie_remove,
28122810
};
28132811
module_platform_driver(tegra_pcie_driver);

0 commit comments

Comments
 (0)