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 <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
This commit is contained in:
parent
289eb3529a
commit
e992ee7eb5
@ -506,7 +506,7 @@ err_pm:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mxc_isi_remove(struct platform_device *pdev)
|
||||
static void mxc_isi_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mxc_isi_dev *isi = platform_get_drvdata(pdev);
|
||||
unsigned int i;
|
||||
@ -523,8 +523,6 @@ static int mxc_isi_remove(struct platform_device *pdev)
|
||||
mxc_isi_v4l2_cleanup(isi);
|
||||
|
||||
pm_runtime_disable(isi->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id mxc_isi_of_match[] = {
|
||||
@ -537,7 +535,7 @@ MODULE_DEVICE_TABLE(of, mxc_isi_of_match);
|
||||
|
||||
static struct platform_driver mxc_isi_driver = {
|
||||
.probe = mxc_isi_probe,
|
||||
.remove = mxc_isi_remove,
|
||||
.remove_new = mxc_isi_remove,
|
||||
.driver = {
|
||||
.of_match_table = mxc_isi_of_match,
|
||||
.name = MXC_ISI_DRIVER_NAME,
|
||||
|
Loading…
x
Reference in New Issue
Block a user