From: Sakari Ailus Date: Tue, 16 Oct 2007 15:08:28 +0000 (+0300) Subject: ARM: OMAP2: Camera: Fix v4l2 int device detach X-Git-Tag: v2.6.24-omap1~253 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c189170e1c76285273ed5937fe4503ebdcbfe30c;p=linux-2.6-omap-h63xx.git 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 --- 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);