Skip to content

Commit 9ea02f7

Browse files
Uwe Kleine-Königandy-shev
authored andcommitted
auxdisplay: hd44780: 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]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 07d0355 commit 9ea02f7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/auxdisplay/hd44780.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static int hd44780_probe(struct platform_device *pdev)
319319
return ret;
320320
}
321321

322-
static int hd44780_remove(struct platform_device *pdev)
322+
static void hd44780_remove(struct platform_device *pdev)
323323
{
324324
struct charlcd *lcd = platform_get_drvdata(pdev);
325325
struct hd44780_common *hdc = lcd->drvdata;
@@ -329,7 +329,6 @@ static int hd44780_remove(struct platform_device *pdev)
329329
kfree(lcd->drvdata);
330330

331331
kfree(lcd);
332-
return 0;
333332
}
334333

335334
static const struct of_device_id hd44780_of_match[] = {
@@ -340,7 +339,7 @@ MODULE_DEVICE_TABLE(of, hd44780_of_match);
340339

341340
static struct platform_driver hd44780_driver = {
342341
.probe = hd44780_probe,
343-
.remove = hd44780_remove,
342+
.remove_new = hd44780_remove,
344343
.driver = {
345344
.name = "hd44780",
346345
.of_match_table = hd44780_of_match,

0 commit comments

Comments
 (0)