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/arcpgu: 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.

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-20-u.kleine-koenig@pengutronix.de

authored by

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

+2 -4
+2 -4
drivers/gpu/drm/tiny/arcpgu.c
··· 404 404 return ret; 405 405 } 406 406 407 - static int arcpgu_remove(struct platform_device *pdev) 407 + static void arcpgu_remove(struct platform_device *pdev) 408 408 { 409 409 struct drm_device *drm = platform_get_drvdata(pdev); 410 410 411 411 drm_dev_unregister(drm); 412 412 arcpgu_unload(drm); 413 - 414 - return 0; 415 413 } 416 414 417 415 static const struct of_device_id arcpgu_of_table[] = { ··· 421 423 422 424 static struct platform_driver arcpgu_platform_driver = { 423 425 .probe = arcpgu_probe, 424 - .remove = arcpgu_remove, 426 + .remove_new = arcpgu_remove, 425 427 .driver = { 426 428 .name = "arcpgu", 427 429 .of_match_table = arcpgu_of_table,