Skip to content

Commit b169c57

Browse files
Uwe Kleine-Königkwilczynski
authored andcommitted
PCI: brcmstb: 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]> Acked-by: Florian Fainelli <[email protected]>
1 parent 60d03f7 commit b169c57

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/pcie-brcmstb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,16 +1396,14 @@ static void __brcm_pcie_remove(struct brcm_pcie *pcie)
13961396
clk_disable_unprepare(pcie->clk);
13971397
}
13981398

1399-
static int brcm_pcie_remove(struct platform_device *pdev)
1399+
static void brcm_pcie_remove(struct platform_device *pdev)
14001400
{
14011401
struct brcm_pcie *pcie = platform_get_drvdata(pdev);
14021402
struct pci_host_bridge *bridge = pci_host_bridge_from_priv(pcie);
14031403

14041404
pci_stop_root_bus(bridge->bus);
14051405
pci_remove_root_bus(bridge->bus);
14061406
__brcm_pcie_remove(pcie);
1407-
1408-
return 0;
14091407
}
14101408

14111409
static const int pcie_offsets[] = {
@@ -1612,7 +1610,7 @@ static const struct dev_pm_ops brcm_pcie_pm_ops = {
16121610

16131611
static struct platform_driver brcm_pcie_driver = {
16141612
.probe = brcm_pcie_probe,
1615-
.remove = brcm_pcie_remove,
1613+
.remove_new = brcm_pcie_remove,
16161614
.driver = {
16171615
.name = "brcm-pcie",
16181616
.of_match_table = brcm_pcie_match,

0 commit comments

Comments
 (0)