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

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

authored by

Uwe Kleine-König and committed by
Mark Brown
75c1ed91 ed354c69

+2 -4
+2 -4
sound/soc/mxs/mxs-sgtl5000.c
··· 169 169 return 0; 170 170 } 171 171 172 - static int mxs_sgtl5000_remove(struct platform_device *pdev) 172 + static void mxs_sgtl5000_remove(struct platform_device *pdev) 173 173 { 174 174 mxs_saif_put_mclk(0); 175 - 176 - return 0; 177 175 } 178 176 179 177 static const struct of_device_id mxs_sgtl5000_dt_ids[] = { ··· 186 188 .of_match_table = mxs_sgtl5000_dt_ids, 187 189 }, 188 190 .probe = mxs_sgtl5000_probe, 189 - .remove = mxs_sgtl5000_remove, 191 + .remove_new = mxs_sgtl5000_remove, 190 192 }; 191 193 192 194 module_platform_driver(mxs_sgtl5000_audio_driver);