History

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.

Uwe Kleine-König committed 3 years ago

Commit afbb9131 parent c7fd95c1 file · +2 −4Browse files

Unified · Split

drivers/pci/controller/pci-xgene-msi.c+2−4
@@ -348,7 +348,7 @@ static void xgene_msi_isr(struct irq_desc *desc) · 347 unmodified lines
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) · 7 unmodified lines
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 = { · 151 unmodified lines
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)