Skip to content

Commit 3a61056

Browse files
Uwe Kleine-Königkwilczynski
authored andcommitted
PCI: altera: 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 b11c76d commit 3a61056

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/pcie-altera.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,21 +806,19 @@ static int altera_pcie_probe(struct platform_device *pdev)
806806
return pci_host_probe(bridge);
807807
}
808808

809-
static int altera_pcie_remove(struct platform_device *pdev)
809+
static void altera_pcie_remove(struct platform_device *pdev)
810810
{
811811
struct altera_pcie *pcie = platform_get_drvdata(pdev);
812812
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
813813

814814
pci_stop_root_bus(bridge->bus);
815815
pci_remove_root_bus(bridge->bus);
816816
altera_pcie_irq_teardown(pcie);
817-
818-
return 0;
819817
}
820818

821819
static struct platform_driver altera_pcie_driver = {
822820
.probe = altera_pcie_probe,
823-
.remove = altera_pcie_remove,
821+
.remove_new = altera_pcie_remove,
824822
.driver = {
825823
.name = "altera-pcie",
826824
.of_match_table = altera_pcie_of_match,

0 commit comments

Comments
 (0)