Skip to content

Commit ad9be16

Browse files
Uwe Kleine-KönigHans Verkuil
authored andcommitted
media: chips-media: wave5: 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: Nicolas Dufresne <[email protected]> Signed-off-by: Sebastian Fricke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 05dc7fc commit ad9be16

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/platform/chips-media/wave5/wave5-vpu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static int wave5_vpu_probe(struct platform_device *pdev)
250250
return ret;
251251
}
252252

253-
static int wave5_vpu_remove(struct platform_device *pdev)
253+
static void wave5_vpu_remove(struct platform_device *pdev)
254254
{
255255
struct vpu_device *dev = dev_get_drvdata(&pdev->dev);
256256

@@ -262,8 +262,6 @@ static int wave5_vpu_remove(struct platform_device *pdev)
262262
v4l2_device_unregister(&dev->v4l2_dev);
263263
wave5_vdi_release(&pdev->dev);
264264
ida_destroy(&dev->inst_ida);
265-
266-
return 0;
267265
}
268266

269267
static const struct wave5_match_data ti_wave521c_data = {
@@ -283,7 +281,7 @@ static struct platform_driver wave5_vpu_driver = {
283281
.of_match_table = of_match_ptr(wave5_dt_ids),
284282
},
285283
.probe = wave5_vpu_probe,
286-
.remove = wave5_vpu_remove,
284+
.remove_new = wave5_vpu_remove,
287285
};
288286

289287
module_platform_driver(wave5_vpu_driver);

0 commit comments

Comments
 (0)