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/armada: 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 the armada drm drivers from always returning zero in
the remove callback to the void returning variant.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jyri Sarha <jyri.sarha@iki.fi>
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-21-u.kleine-koenig@pengutronix.de

authored by

Uwe Kleine-König and committed by
Thomas Zimmermann
b4791474 da20c383

+4 -6
+2 -3
drivers/gpu/drm/armada/armada_crtc.c
··· 1066 1066 return component_add(&pdev->dev, &armada_lcd_ops); 1067 1067 } 1068 1068 1069 - static int armada_lcd_remove(struct platform_device *pdev) 1069 + static void armada_lcd_remove(struct platform_device *pdev) 1070 1070 { 1071 1071 component_del(&pdev->dev, &armada_lcd_ops); 1072 - return 0; 1073 1072 } 1074 1073 1075 1074 static const struct of_device_id armada_lcd_of_match[] = { ··· 1094 1095 1095 1096 struct platform_driver armada_lcd_platform_driver = { 1096 1097 .probe = armada_lcd_probe, 1097 - .remove = armada_lcd_remove, 1098 + .remove_new = armada_lcd_remove, 1098 1099 .driver = { 1099 1100 .name = "armada-lcd", 1100 1101 .owner = THIS_MODULE,
+2 -3
drivers/gpu/drm/armada/armada_drv.c
··· 226 226 match); 227 227 } 228 228 229 - static int armada_drm_remove(struct platform_device *pdev) 229 + static void armada_drm_remove(struct platform_device *pdev) 230 230 { 231 231 component_master_del(&pdev->dev, &armada_master_ops); 232 - return 0; 233 232 } 234 233 235 234 static void armada_drm_shutdown(struct platform_device *pdev) ··· 248 249 249 250 static struct platform_driver armada_drm_platform_driver = { 250 251 .probe = armada_drm_probe, 251 - .remove = armada_drm_remove, 252 + .remove_new = armada_drm_remove, 252 253 .shutdown = armada_drm_shutdown, 253 254 .driver = { 254 255 .name = "armada-drm",