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

ASoC: xtensa: xtfpga-i2s: 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-172-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
cbde81bc 407a27b7

+2 -3
+2 -3
sound/soc/xtensa/xtfpga-i2s.c
··· 605 605 return err; 606 606 } 607 607 608 - static int xtfpga_i2s_remove(struct platform_device *pdev) 608 + static void xtfpga_i2s_remove(struct platform_device *pdev) 609 609 { 610 610 struct xtfpga_i2s *i2s = dev_get_drvdata(&pdev->dev); 611 611 ··· 618 618 pm_runtime_disable(&pdev->dev); 619 619 if (!pm_runtime_status_suspended(&pdev->dev)) 620 620 xtfpga_i2s_runtime_suspend(&pdev->dev); 621 - return 0; 622 621 } 623 622 624 623 #ifdef CONFIG_OF ··· 635 636 636 637 static struct platform_driver xtfpga_i2s_driver = { 637 638 .probe = xtfpga_i2s_probe, 638 - .remove = xtfpga_i2s_remove, 639 + .remove_new = xtfpga_i2s_remove, 639 640 .driver = { 640 641 .name = "xtfpga-i2s", 641 642 .of_match_table = of_match_ptr(xtfpga_i2s_of_match),