mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 18:36:00 +00:00
powerpc/512x: lpbfifo: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() is renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230711143145.1192651-1-u.kleine-koenig@pengutronix.de
This commit is contained in:
parent
fb74c4e3be
commit
8739312ed2
@ -477,7 +477,7 @@ static int mpc512x_lpbfifo_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mpc512x_lpbfifo_remove(struct platform_device *pdev)
|
||||
static void mpc512x_lpbfifo_remove(struct platform_device *pdev)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct dma_device *dma_dev = lpbfifo.chan->device;
|
||||
@ -494,8 +494,6 @@ static int mpc512x_lpbfifo_remove(struct platform_device *pdev)
|
||||
free_irq(lpbfifo.irq, &pdev->dev);
|
||||
irq_dispose_mapping(lpbfifo.irq);
|
||||
dma_release_channel(lpbfifo.chan);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id mpc512x_lpbfifo_match[] = {
|
||||
@ -506,7 +504,7 @@ MODULE_DEVICE_TABLE(of, mpc512x_lpbfifo_match);
|
||||
|
||||
static struct platform_driver mpc512x_lpbfifo_driver = {
|
||||
.probe = mpc512x_lpbfifo_probe,
|
||||
.remove = mpc512x_lpbfifo_remove,
|
||||
.remove_new = mpc512x_lpbfifo_remove,
|
||||
.driver = {
|
||||
.name = DRV_NAME,
|
||||
.of_match_table = mpc512x_lpbfifo_match,
|
||||
|
Loading…
x
Reference in New Issue
Block a user