Skip to content

Commit bce36aa

Browse files
Uwe Kleine-Königtiwai
authored andcommitted
OSS: dmasound/paula: 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() will be 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> Link: https://lore.kernel.org/r/20231107151223.3971602-2-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 6ae90e9 commit bce36aa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sound/oss/dmasound/dmasound_paula.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,15 +720,14 @@ static int __init amiga_audio_probe(struct platform_device *pdev)
720720
return dmasound_init();
721721
}
722722

723-
static int __exit amiga_audio_remove(struct platform_device *pdev)
723+
static void __exit amiga_audio_remove(struct platform_device *pdev)
724724
{
725725
dmasound_deinit();
726-
return 0;
727726
}
728727

729728
static struct platform_driver amiga_audio_driver = {
730-
.remove = __exit_p(amiga_audio_remove),
731-
.driver = {
729+
.remove_new = __exit_p(amiga_audio_remove),
730+
.driver = {
732731
.name = "amiga-audio",
733732
},
734733
};

0 commit comments

Comments
 (0)