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

drm/tegra: vic: 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: Thierry Reding <treding@nvidia.com>

authored by

Uwe Kleine-König and committed by
Thierry Reding
9eb75fbf 3b6f8900

+2 -4
+2 -4
drivers/gpu/drm/tegra/vic.c
··· 537 537 return err; 538 538 } 539 539 540 - static int vic_remove(struct platform_device *pdev) 540 + static void vic_remove(struct platform_device *pdev) 541 541 { 542 542 struct vic *vic = platform_get_drvdata(pdev); 543 543 544 544 host1x_client_unregister(&vic->client.base); 545 545 546 546 falcon_exit(&vic->falcon); 547 - 548 - return 0; 549 547 } 550 548 551 549 static const struct dev_pm_ops vic_pm_ops = { ··· 558 560 .pm = &vic_pm_ops 559 561 }, 560 562 .probe = vic_probe, 561 - .remove = vic_remove, 563 + .remove_new = vic_remove, 562 564 }; 563 565 564 566 #if IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC)