Skip to content

Commit 832c17b

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
char: xillybus: 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: Eli Billauer <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 71cfc13 commit 832c17b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/char/xillybus/xillybus_of.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,17 @@ static int xilly_drv_probe(struct platform_device *op)
6464
return xillybus_endpoint_discovery(endpoint);
6565
}
6666

67-
static int xilly_drv_remove(struct platform_device *op)
67+
static void xilly_drv_remove(struct platform_device *op)
6868
{
6969
struct device *dev = &op->dev;
7070
struct xilly_endpoint *endpoint = dev_get_drvdata(dev);
7171

7272
xillybus_endpoint_remove(endpoint);
73-
74-
return 0;
7573
}
7674

7775
static struct platform_driver xillybus_platform_driver = {
7876
.probe = xilly_drv_probe,
79-
.remove = xilly_drv_remove,
77+
.remove_new = xilly_drv_remove,
8078
.driver = {
8179
.name = xillyname,
8280
.of_match_table = xillybus_of_match,

0 commit comments

Comments
 (0)