Skip to content

Commit 60d03f7

Browse files
Uwe Kleine-Königkwilczynski
authored andcommitted
PCI: altera-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 3a61056 commit 60d03f7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/pci/controller/pcie-altera-msi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static void altera_free_domains(struct altera_msi *msi)
197197
irq_domain_remove(msi->inner_domain);
198198
}
199199

200-
static int altera_msi_remove(struct platform_device *pdev)
200+
static void altera_msi_remove(struct platform_device *pdev)
201201
{
202202
struct altera_msi *msi = platform_get_drvdata(pdev);
203203

@@ -207,7 +207,6 @@ static int altera_msi_remove(struct platform_device *pdev)
207207
altera_free_domains(msi);
208208

209209
platform_set_drvdata(pdev, NULL);
210-
return 0;
211210
}
212211

213212
static int altera_msi_probe(struct platform_device *pdev)
@@ -275,7 +274,7 @@ static struct platform_driver altera_msi_driver = {
275274
.of_match_table = altera_msi_of_match,
276275
},
277276
.probe = altera_msi_probe,
278-
.remove = altera_msi_remove,
277+
.remove_new = altera_msi_remove,
279278
};
280279

281280
static int __init altera_msi_init(void)

0 commit comments

Comments
 (0)