Skip to content

Commit afbb913

Browse files
Uwe Kleine-Königkwilczynski
authored andcommitted
PCI: xgene-msi: 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 c7fd95c commit afbb913

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/pci/controller/pci-xgene-msi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static void xgene_msi_isr(struct irq_desc *desc)
348348

349349
static enum cpuhp_state pci_xgene_online;
350350

351-
static int xgene_msi_remove(struct platform_device *pdev)
351+
static void xgene_msi_remove(struct platform_device *pdev)
352352
{
353353
struct xgene_msi *msi = platform_get_drvdata(pdev);
354354

@@ -362,8 +362,6 @@ static int xgene_msi_remove(struct platform_device *pdev)
362362
msi->bitmap = NULL;
363363

364364
xgene_free_domains(msi);
365-
366-
return 0;
367365
}
368366

369367
static int xgene_msi_hwirq_alloc(unsigned int cpu)
@@ -521,7 +519,7 @@ static struct platform_driver xgene_msi_driver = {
521519
.of_match_table = xgene_msi_match_table,
522520
},
523521
.probe = xgene_msi_probe,
524-
.remove = xgene_msi_remove,
522+
.remove_new = xgene_msi_remove,
525523
};
526524

527525
static int __init xgene_pcie_msi_init(void)

0 commit comments

Comments
 (0)