Skip to content

Commit 365fcc0

Browse files
Uwe Kleine-Königkrzk
authored andcommitted
memory: ti-emif-pm: 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/c69f64ad0e89fe2a37b281d44ebfb55b565b50bf.1702822744.git.u.kleine-koenig@pengutronix.de Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 7852eb8 commit 365fcc0

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/memory/ti-emif-pm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,13 @@ static int ti_emif_probe(struct platform_device *pdev)
315315
return ret;
316316
}
317317

318-
static int ti_emif_remove(struct platform_device *pdev)
318+
static void ti_emif_remove(struct platform_device *pdev)
319319
{
320320
struct ti_emif_data *emif_data = emif_instance;
321321

322322
emif_instance = NULL;
323323

324324
ti_emif_free_sram(emif_data);
325-
326-
return 0;
327325
}
328326

329327
static const struct dev_pm_ops ti_emif_pm_ops = {
@@ -332,7 +330,7 @@ static const struct dev_pm_ops ti_emif_pm_ops = {
332330

333331
static struct platform_driver ti_emif_driver = {
334332
.probe = ti_emif_probe,
335-
.remove = ti_emif_remove,
333+
.remove_new = ti_emif_remove,
336334
.driver = {
337335
.name = KBUILD_MODNAME,
338336
.of_match_table = ti_emif_of_match,

0 commit comments

Comments
 (0)