From c189170e1c76285273ed5937fe4503ebdcbfe30c Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Tue, 16 Oct 2007 18:08:28 +0300 Subject: [PATCH] ARM: OMAP2: Camera: Fix v4l2 int device detach omap24xxcam_device_unregister expected the argument to be its own device structure but it's actually that of its slave. Also get master from slave's structure in omap24xxcam_device_register. Signed-off-by: Sakari Ailus Signed-off-by: Tony Lindgren --- drivers/media/video/omap24xxcam.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c index 7da1668384e..8fda9e1c2a7 100644 --- a/drivers/media/video/omap24xxcam.c +++ b/drivers/media/video/omap24xxcam.c @@ -46,7 +46,7 @@ static void omap24xxcam_reset(struct omap24xxcam_device *cam); static int omap24xxcam_sensor_if_enable(struct omap24xxcam_device *cam); -static void omap24xxcam_device_unregister(struct v4l2_int_device *ctl); +static void omap24xxcam_device_unregister(struct v4l2_int_device *s); static int omap24xxcam_remove(struct platform_device *pdev); /* module parameters */ @@ -1603,10 +1603,9 @@ static int omap24xxcam_resume(struct platform_device *pdev) * */ -static int omap24xxcam_device_register(struct v4l2_int_device *ctl, - struct v4l2_int_device *s) +static int omap24xxcam_device_register(struct v4l2_int_device *s) { - struct omap24xxcam_device *cam = ctl->priv; + struct omap24xxcam_device *cam = s->u.slave->master->priv; struct video_device *vfd; int rval; @@ -1681,14 +1680,14 @@ static int omap24xxcam_device_register(struct v4l2_int_device *ctl, return 0; err: - omap24xxcam_device_unregister(ctl); + omap24xxcam_device_unregister(s); return rval; } -static void omap24xxcam_device_unregister(struct v4l2_int_device *ctl) +static void omap24xxcam_device_unregister(struct v4l2_int_device *s) { - struct omap24xxcam_device *cam = ctl->priv; + struct omap24xxcam_device *cam = s->u.slave->master->priv; omap24xxcam_sensor_exit(cam); -- 2.41.1