Skip to content

Commit 8013408

Browse files
Uwe Kleine-Königkrzk
authored andcommitted
memory: exynos5422-dmc: 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 ignored (apart from emitting a warning) 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. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). 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> Link: https://lore.kernel.org/r/167dbda286584eafec07da8c11673da07ba72362.1702822744.git.u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 961abc9 commit 8013408

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/memory/samsung/exynos5422-dmc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ static int exynos5_dmc_probe(struct platform_device *pdev)
15581558
* clean the device's resources. It just calls explicitly disable function for
15591559
* the performance counters.
15601560
*/
1561-
static int exynos5_dmc_remove(struct platform_device *pdev)
1561+
static void exynos5_dmc_remove(struct platform_device *pdev)
15621562
{
15631563
struct exynos5_dmc *dmc = dev_get_drvdata(&pdev->dev);
15641564

@@ -1569,8 +1569,6 @@ static int exynos5_dmc_remove(struct platform_device *pdev)
15691569

15701570
clk_disable_unprepare(dmc->mout_bpll);
15711571
clk_disable_unprepare(dmc->fout_bpll);
1572-
1573-
return 0;
15741572
}
15751573

15761574
static const struct of_device_id exynos5_dmc_of_match[] = {
@@ -1581,7 +1579,7 @@ MODULE_DEVICE_TABLE(of, exynos5_dmc_of_match);
15811579

15821580
static struct platform_driver exynos5_dmc_platdrv = {
15831581
.probe = exynos5_dmc_probe,
1584-
.remove = exynos5_dmc_remove,
1582+
.remove_new = exynos5_dmc_remove,
15851583
.driver = {
15861584
.name = "exynos5-dmc",
15871585
.of_match_table = exynos5_dmc_of_match,

0 commit comments

Comments
 (0)