Skip to content

Commit 297f26d

Browse files
Uwe Kleine-Königpateldipen1984-nv
authored andcommitted
hte: tegra-194: 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 <[email protected]> Acked-by: Thierry Reding <[email protected]> Acked-by: Dipen Patel <[email protected]> Signed-off-by: Dipen Patel <[email protected]>
1 parent 4cece76 commit 297f26d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/hte/hte-tegra194-test.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,21 +214,19 @@ static int tegra_hte_test_probe(struct platform_device *pdev)
214214
return ret;
215215
}
216216

217-
static int tegra_hte_test_remove(struct platform_device *pdev)
217+
static void tegra_hte_test_remove(struct platform_device *pdev)
218218
{
219219
(void)pdev;
220220

221221
free_irq(hte.gpio_in_irq, &hte);
222222
gpiod_put(hte.gpio_in);
223223
gpiod_put(hte.gpio_out);
224224
del_timer_sync(&hte.timer);
225-
226-
return 0;
227225
}
228226

229227
static struct platform_driver tegra_hte_test_driver = {
230228
.probe = tegra_hte_test_probe,
231-
.remove = tegra_hte_test_remove,
229+
.remove_new = tegra_hte_test_remove,
232230
.driver = {
233231
.name = "tegra_hte_test",
234232
.of_match_table = tegra_hte_test_of_match,

0 commit comments

Comments
 (0)