Skip to content

Commit e992ee7

Browse files
Uwe Kleine-KönigHans Verkuil
authored andcommitted
media: nxp: imx8-isi: 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: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent 289eb35 commit e992ee7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/media/platform/nxp/imx8-isi/imx8-isi-core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ static int mxc_isi_probe(struct platform_device *pdev)
506506
return ret;
507507
}
508508

509-
static int mxc_isi_remove(struct platform_device *pdev)
509+
static void mxc_isi_remove(struct platform_device *pdev)
510510
{
511511
struct mxc_isi_dev *isi = platform_get_drvdata(pdev);
512512
unsigned int i;
@@ -523,8 +523,6 @@ static int mxc_isi_remove(struct platform_device *pdev)
523523
mxc_isi_v4l2_cleanup(isi);
524524

525525
pm_runtime_disable(isi->dev);
526-
527-
return 0;
528526
}
529527

530528
static const struct of_device_id mxc_isi_of_match[] = {
@@ -537,7 +535,7 @@ MODULE_DEVICE_TABLE(of, mxc_isi_of_match);
537535

538536
static struct platform_driver mxc_isi_driver = {
539537
.probe = mxc_isi_probe,
540-
.remove = mxc_isi_remove,
538+
.remove_new = mxc_isi_remove,
541539
.driver = {
542540
.of_match_table = mxc_isi_of_match,
543541
.name = MXC_ISI_DRIVER_NAME,

0 commit comments

Comments
 (0)