Skip to content

Commit 4a62832

Browse files
Uwe Kleine-KönigVudentz
authored andcommitted
Bluetooth: btqcomsmd: 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: Luiz Augusto von Dentz <[email protected]>
1 parent 8c0401b commit 4a62832

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/bluetooth/btqcomsmd.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int btqcomsmd_probe(struct platform_device *pdev)
197197
return ret;
198198
}
199199

200-
static int btqcomsmd_remove(struct platform_device *pdev)
200+
static void btqcomsmd_remove(struct platform_device *pdev)
201201
{
202202
struct btqcomsmd *btq = platform_get_drvdata(pdev);
203203

@@ -206,8 +206,6 @@ static int btqcomsmd_remove(struct platform_device *pdev)
206206

207207
rpmsg_destroy_ept(btq->cmd_channel);
208208
rpmsg_destroy_ept(btq->acl_channel);
209-
210-
return 0;
211209
}
212210

213211
static const struct of_device_id btqcomsmd_of_match[] = {
@@ -218,7 +216,7 @@ MODULE_DEVICE_TABLE(of, btqcomsmd_of_match);
218216

219217
static struct platform_driver btqcomsmd_driver = {
220218
.probe = btqcomsmd_probe,
221-
.remove = btqcomsmd_remove,
219+
.remove_new = btqcomsmd_remove,
222220
.driver = {
223221
.name = "btqcomsmd",
224222
.of_match_table = btqcomsmd_of_match,

0 commit comments

Comments
 (0)