diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2023-03-26 16:31:04 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-04-11 16:59:16 +0200 |
commit | 447925334c0614cc78b915b27bca328ee4d470a7 (patch) | |
tree | 14776f1c20683c9cc2dba0a5d19452122a1ac78a /drivers/media/platform/nxp | |
parent | 0c43a7413c8ed940d1aa0df758f2b849682a480a (diff) |
media: mxc-jpeg: 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 (mostly) ignored
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.
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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform/nxp')
-rw-r--r-- | drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c index c898116b763a..6b0d47e3530f 100644 --- a/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c @@ -2627,7 +2627,7 @@ static const struct dev_pm_ops mxc_jpeg_pm_ops = { SET_SYSTEM_SLEEP_PM_OPS(mxc_jpeg_suspend, mxc_jpeg_resume) }; -static int mxc_jpeg_remove(struct platform_device *pdev) +static void mxc_jpeg_remove(struct platform_device *pdev) { unsigned int slot; struct mxc_jpeg_dev *jpeg = platform_get_drvdata(pdev); @@ -2640,15 +2640,13 @@ static int mxc_jpeg_remove(struct platform_device *pdev) v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); mxc_jpeg_detach_pm_domains(jpeg); - - return 0; } MODULE_DEVICE_TABLE(of, mxc_jpeg_match); static struct platform_driver mxc_jpeg_driver = { .probe = mxc_jpeg_probe, - .remove = mxc_jpeg_remove, + .remove_new = mxc_jpeg_remove, .driver = { .name = "mxc-jpeg", .of_match_table = mxc_jpeg_match, |