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
348 348
349static enum cpuhp_state pci_xgene_online;349static enum cpuhp_state pci_xgene_online;
350 350
351static int xgene_msi_remove(struct platform_device *pdev)351static void xgene_msi_remove(struct platform_device *pdev)
352{352{
353 struct xgene_msi *msi = platform_get_drvdata(pdev);353 struct xgene_msi *msi = platform_get_drvdata(pdev);
354 354
@@ -362,8 +362,6 @@ static int xgene_msi_remove(struct platform_device *pdev) · 7 unmodified lines
362 msi->bitmap = NULL;362 msi->bitmap = NULL;
363 363
364 xgene_free_domains(msi);364 xgene_free_domains(msi);
365
366 return 0;
367}365}
368 366
369static int xgene_msi_hwirq_alloc(unsigned int cpu)367static int xgene_msi_hwirq_alloc(unsigned int cpu)
@@ -521,7 +519,7 @@ static struct platform_driver xgene_msi_driver = { · 151 unmodified lines
521 .of_match_table = xgene_msi_match_table,519 .of_match_table = xgene_msi_match_table,
522 },520 },
523 .probe = xgene_msi_probe,521 .probe = xgene_msi_probe,
524 .remove = xgene_msi_remove,522 .remove_new = xgene_msi_remove,
525};523};
526 524
527static int __init xgene_pcie_msi_init(void)525static int __init xgene_pcie_msi_init(void)