Skip to content

Commit c86f4bd

Browse files
Uwe Kleine-Königkwilczynski
authored andcommitted
PCI: j721e: 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. [kwilczynski: commit log] 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 b169c57 commit c86f4bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/cadence/pci-j721e.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static int j721e_pcie_probe(struct platform_device *pdev)
542542
return ret;
543543
}
544544

545-
static int j721e_pcie_remove(struct platform_device *pdev)
545+
static void j721e_pcie_remove(struct platform_device *pdev)
546546
{
547547
struct j721e_pcie *pcie = platform_get_drvdata(pdev);
548548
struct cdns_pcie *cdns_pcie = pcie->cdns_pcie;
@@ -552,13 +552,11 @@ static int j721e_pcie_remove(struct platform_device *pdev)
552552
cdns_pcie_disable_phy(cdns_pcie);
553553
pm_runtime_put(dev);
554554
pm_runtime_disable(dev);
555-
556-
return 0;
557555
}
558556

559557
static struct platform_driver j721e_pcie_driver = {
560558
.probe = j721e_pcie_probe,
561-
.remove = j721e_pcie_remove,
559+
.remove_new = j721e_pcie_remove,
562560
.driver = {
563561
.name = "j721e-pcie",
564562
.of_match_table = of_j721e_pcie_match,

0 commit comments

Comments
 (0)