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

ASoC: codecs: wm8997: 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-61-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Uwe Kleine-König and committed by
Mark Brown
e1df73df 63d3f580

+2 -4
+2 -4
sound/soc/codecs/wm8997.c
··· 1193 1193 return ret; 1194 1194 } 1195 1195 1196 - static int wm8997_remove(struct platform_device *pdev) 1196 + static void wm8997_remove(struct platform_device *pdev) 1197 1197 { 1198 1198 struct wm8997_priv *wm8997 = platform_get_drvdata(pdev); 1199 1199 struct arizona *arizona = wm8997->core.arizona; ··· 1203 1203 arizona_free_spk_irqs(arizona); 1204 1204 1205 1205 arizona_jack_codec_dev_remove(&wm8997->core); 1206 - 1207 - return 0; 1208 1206 } 1209 1207 1210 1208 static struct platform_driver wm8997_codec_driver = { ··· 1210 1212 .name = "wm8997-codec", 1211 1213 }, 1212 1214 .probe = wm8997_probe, 1213 - .remove = wm8997_remove, 1215 + .remove_new = wm8997_remove, 1214 1216 }; 1215 1217 1216 1218 module_platform_driver(wm8997_codec_driver);