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.

drm/bridge: tpd12s015: 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>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-24-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Thomas Zimmermann
3cdbe598 3438cf17

+2 -4
+2 -4
drivers/gpu/drm/bridge/ti-tpd12s015.c
··· 179 179 return 0; 180 180 } 181 181 182 - static int tpd12s015_remove(struct platform_device *pdev) 182 + static void tpd12s015_remove(struct platform_device *pdev) 183 183 { 184 184 struct tpd12s015_device *tpd = platform_get_drvdata(pdev); 185 185 186 186 drm_bridge_remove(&tpd->bridge); 187 - 188 - return 0; 189 187 } 190 188 191 189 static const struct of_device_id tpd12s015_of_match[] = { ··· 195 197 196 198 static struct platform_driver tpd12s015_driver = { 197 199 .probe = tpd12s015_probe, 198 - .remove = tpd12s015_remove, 200 + .remove_new = tpd12s015_remove, 199 201 .driver = { 200 202 .name = "tpd12s015", 201 203 .of_match_table = tpd12s015_of_match,