Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: sparc/dbri: 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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-174-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
9fa6137d 44e4b6ee

+2 -4
+2 -4
sound/sparc/dbri.c
··· 2656 2656 return err; 2657 2657 } 2658 2658 2659 - static int dbri_remove(struct platform_device *op) 2659 + static void dbri_remove(struct platform_device *op) 2660 2660 { 2661 2661 struct snd_card *card = dev_get_drvdata(&op->dev); 2662 2662 2663 2663 snd_dbri_free(card->private_data); 2664 2664 snd_card_free(card); 2665 - 2666 - return 0; 2667 2665 } 2668 2666 2669 2667 static const struct of_device_id dbri_match[] = { ··· 2682 2684 .of_match_table = dbri_match, 2683 2685 }, 2684 2686 .probe = dbri_probe, 2685 - .remove = dbri_remove, 2687 + .remove_new = dbri_remove, 2686 2688 }; 2687 2689 2688 2690 module_platform_driver(dbri_sbus_driver);