Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: vde: 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.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Uwe Kleine-König and committed by
Hans Verkuil
9045184b 447728bd

+2 -4
+2 -4
drivers/media/platform/nvidia/tegra-vde/vde.c
··· 378 378 return err; 379 379 } 380 380 381 - static int tegra_vde_remove(struct platform_device *pdev) 381 + static void tegra_vde_remove(struct platform_device *pdev) 382 382 { 383 383 struct tegra_vde *vde = platform_get_drvdata(pdev); 384 384 struct device *dev = &pdev->dev; ··· 407 407 408 408 gen_pool_free(vde->iram_pool, (unsigned long)vde->iram, 409 409 gen_pool_size(vde->iram_pool)); 410 - 411 - return 0; 412 410 } 413 411 414 412 static void tegra_vde_shutdown(struct platform_device *pdev) ··· 534 536 535 537 static struct platform_driver tegra_vde_driver = { 536 538 .probe = tegra_vde_probe, 537 - .remove = tegra_vde_remove, 539 + .remove_new = tegra_vde_remove, 538 540 .shutdown = tegra_vde_shutdown, 539 541 .driver = { 540 542 .name = "tegra-vde",