Skip to content

Commit baaa90c

Browse files
Uwe Kleine-Königmiquelraynal
authored andcommitted
mtd: hyperbus: rpc-if: 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]> Signed-off-by: Miquel Raynal <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 59bd567 commit baaa90c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/mtd/hyperbus/rpc-if.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,20 +154,18 @@ static int rpcif_hb_probe(struct platform_device *pdev)
154154
return error;
155155
}
156156

157-
static int rpcif_hb_remove(struct platform_device *pdev)
157+
static void rpcif_hb_remove(struct platform_device *pdev)
158158
{
159159
struct rpcif_hyperbus *hyperbus = platform_get_drvdata(pdev);
160160

161161
hyperbus_unregister_device(&hyperbus->hbdev);
162162

163163
pm_runtime_disable(hyperbus->rpc.dev);
164-
165-
return 0;
166164
}
167165

168166
static struct platform_driver rpcif_platform_driver = {
169167
.probe = rpcif_hb_probe,
170-
.remove = rpcif_hb_remove,
168+
.remove_new = rpcif_hb_remove,
171169
.driver = {
172170
.name = "rpc-if-hyperflash",
173171
},

0 commit comments

Comments
 (0)