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

ASoC: codecs: cs47l35: 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: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20230315150745.67084-45-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
b9cc4f89 90fc2cd0

+2 -4
+2 -4
sound/soc/codecs/cs47l35.c
··· 1744 1744 return ret; 1745 1745 } 1746 1746 1747 - static int cs47l35_remove(struct platform_device *pdev) 1747 + static void cs47l35_remove(struct platform_device *pdev) 1748 1748 { 1749 1749 struct cs47l35 *cs47l35 = platform_get_drvdata(pdev); 1750 1750 int i; ··· 1758 1758 madera_free_irq(cs47l35->core.madera, MADERA_IRQ_DSP_IRQ1, cs47l35); 1759 1759 madera_free_overheat(&cs47l35->core); 1760 1760 madera_core_free(&cs47l35->core); 1761 - 1762 - return 0; 1763 1761 } 1764 1762 1765 1763 static struct platform_driver cs47l35_codec_driver = { ··· 1765 1767 .name = "cs47l35-codec", 1766 1768 }, 1767 1769 .probe = &cs47l35_probe, 1768 - .remove = &cs47l35_remove, 1770 + .remove_new = cs47l35_remove, 1769 1771 }; 1770 1772 1771 1773 module_platform_driver(cs47l35_codec_driver);