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/etnaviv: 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 etnaviv drm 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>
Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20231102165640.3307820-25-u.kleine-koenig@pengutronix.de

authored by

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

+4 -7
+2 -4
drivers/gpu/drm/etnaviv/etnaviv_drv.c
··· 640 640 return component_master_add_with_match(dev, &etnaviv_master_ops, match); 641 641 } 642 642 643 - static int etnaviv_pdev_remove(struct platform_device *pdev) 643 + static void etnaviv_pdev_remove(struct platform_device *pdev) 644 644 { 645 645 component_master_del(&pdev->dev, &etnaviv_master_ops); 646 - 647 - return 0; 648 646 } 649 647 650 648 static struct platform_driver etnaviv_platform_driver = { 651 649 .probe = etnaviv_pdev_probe, 652 - .remove = etnaviv_pdev_remove, 650 + .remove_new = etnaviv_pdev_remove, 653 651 .driver = { 654 652 .name = "etnaviv", 655 653 },
+2 -3
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
··· 1904 1904 return 0; 1905 1905 } 1906 1906 1907 - static int etnaviv_gpu_platform_remove(struct platform_device *pdev) 1907 + static void etnaviv_gpu_platform_remove(struct platform_device *pdev) 1908 1908 { 1909 1909 component_del(&pdev->dev, &gpu_ops); 1910 1910 pm_runtime_disable(&pdev->dev); 1911 - return 0; 1912 1911 } 1913 1912 1914 1913 static int etnaviv_gpu_rpm_suspend(struct device *dev) ··· 1969 1970 .of_match_table = etnaviv_gpu_match, 1970 1971 }, 1971 1972 .probe = etnaviv_gpu_platform_probe, 1972 - .remove = etnaviv_gpu_platform_remove, 1973 + .remove_new = etnaviv_gpu_platform_remove, 1973 1974 .id_table = gpu_ids, 1974 1975 };