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>
This commit is contained in:
parent
66d721ca1c
commit
e0191f305f
@ -258,12 +258,10 @@ static int twl4030_audio_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int twl4030_audio_remove(struct platform_device *pdev)
|
||||
static void twl4030_audio_remove(struct platform_device *pdev)
|
||||
{
|
||||
mfd_remove_devices(&pdev->dev);
|
||||
twl4030_audio_dev = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id twl4030_audio_of_match[] = {
|
||||
@ -278,7 +276,7 @@ static struct platform_driver twl4030_audio_driver = {
|
||||
.of_match_table = twl4030_audio_of_match,
|
||||
},
|
||||
.probe = twl4030_audio_probe,
|
||||
.remove = twl4030_audio_remove,
|
||||
.remove_new = twl4030_audio_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(twl4030_audio_driver);
|
||||
|
Loading…
Reference in New Issue
Block a user