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

Configure Feed

Select the types of activity you want to include in your feed.

mfd: twl4030-audio: 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 ignored (apart
from emitting a warning) 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. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

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>
Link: https://lore.kernel.org/r/20231123165627.492259-19-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Uwe Kleine-König and committed by
Lee Jones
e0191f30 66d721ca

+2 -4
+2 -4
drivers/mfd/twl4030-audio.c
··· 258 258 return ret; 259 259 } 260 260 261 - static int twl4030_audio_remove(struct platform_device *pdev) 261 + static void twl4030_audio_remove(struct platform_device *pdev) 262 262 { 263 263 mfd_remove_devices(&pdev->dev); 264 264 twl4030_audio_dev = NULL; 265 - 266 - return 0; 267 265 } 268 266 269 267 static const struct of_device_id twl4030_audio_of_match[] = { ··· 276 278 .of_match_table = twl4030_audio_of_match, 277 279 }, 278 280 .probe = twl4030_audio_probe, 279 - .remove = twl4030_audio_remove, 281 + .remove_new = twl4030_audio_remove, 280 282 }; 281 283 282 284 module_platform_driver(twl4030_audio_driver);