summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/marvell/mmp-driver.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-03-26 16:30:51 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 16:59:15 +0200
commit94eca0c00aaf5c7f2440effb1587d01a6562198c (patch)
tree97ca853762b37008ba613d0fcf9953cdbd55912e /drivers/media/platform/marvell/mmp-driver.c
parentc65cee0b875098716fb4198aa331bac04ec0d737 (diff)
downloadlinux-stable-94eca0c00aaf5c7f2440effb1587d01a6562198c.tar.gz
linux-stable-94eca0c00aaf5c7f2440effb1587d01a6562198c.tar.bz2
linux-stable-94eca0c00aaf5c7f2440effb1587d01a6562198c.zip
media: marvell: Simplify remove callback
Fold mmpcam_remove() into its only caller mmpcam_platform_remove(). Note that cam can never be zero, as the probe function calls platform_set_drvdata() with a non-NULL argument (or returns an error code in which case .remove() won't be called). Also use mmpcam_remove() as the function name for the remove callback to align to mmpcam_probe() for .probe(). 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/marvell/mmp-driver.c')
-rw-r--r--drivers/media/platform/marvell/mmp-driver.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/media/platform/marvell/mmp-driver.c b/drivers/media/platform/marvell/mmp-driver.c
index ef22bf8f276c..964c55eacd89 100644
--- a/drivers/media/platform/marvell/mmp-driver.c
+++ b/drivers/media/platform/marvell/mmp-driver.c
@@ -287,9 +287,9 @@ out:
return ret;
}
-
-static int mmpcam_remove(struct mmp_camera *cam)
+static int mmpcam_remove(struct platform_device *pdev)
{
+ struct mmp_camera *cam = platform_get_drvdata(pdev);
struct mcam_camera *mcam = &cam->mcam;
mccic_shutdown(mcam);
@@ -297,15 +297,6 @@ static int mmpcam_remove(struct mmp_camera *cam)
return 0;
}
-static int mmpcam_platform_remove(struct platform_device *pdev)
-{
- struct mmp_camera *cam = platform_get_drvdata(pdev);
-
- if (cam == NULL)
- return -ENODEV;
- return mmpcam_remove(cam);
-}
-
/*
* Suspend/resume support.
*/
@@ -369,7 +360,7 @@ MODULE_DEVICE_TABLE(of, mmpcam_of_match);
static struct platform_driver mmpcam_driver = {
.probe = mmpcam_probe,
- .remove = mmpcam_platform_remove,
+ .remove = mmpcam_remove,
.driver = {
.name = "mmp-camera",
.of_match_table = of_match_ptr(mmpcam_of_match),