From: Eduardo Valentin Date: Wed, 21 Nov 2007 22:23:04 +0000 (-0400) Subject: ARM: OMAP1: Camera: Fix v4l2 int device detach X-Git-Tag: v2.6.24-omap1~149 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7884528e07533a355d998f83e993dca0ed88b68f;p=linux-2.6-omap-h63xx.git ARM: OMAP1: Camera: Fix v4l2 int device detach camera_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 camera_device_register. Signed-off-by: Eduardo Valentin Signed-off-by: Tony Lindgren --- diff --git a/drivers/media/video/omap/camera_core.c b/drivers/media/video/omap/camera_core.c index 6e5d8bdf33e..be033bea286 100644 --- a/drivers/media/video/omap/camera_core.c +++ b/drivers/media/video/omap/camera_core.c @@ -1007,17 +1007,16 @@ static ssize_t camera_streaming_show(struct device *dev, static DEVICE_ATTR(streaming, S_IRUGO, camera_streaming_show, NULL); -static void camera_device_unregister(struct v4l2_int_device *ctl) +static void camera_device_unregister(struct v4l2_int_device *s) { - struct camera_device *cam = ctl->priv; + struct camera_device *cam = s->u.slave->master->priv; camera_sensor_exit(cam); } -static int camera_device_register(struct v4l2_int_device *ctl, - struct v4l2_int_device *s) +static int camera_device_register(struct v4l2_int_device *s) { - struct camera_device *cam = ctl->priv; + struct camera_device *cam = s->u.slave->master->priv; struct video_device *vfd; int rval; @@ -1092,7 +1091,7 @@ static int camera_device_register(struct v4l2_int_device *ctl, return 0; err: - camera_device_unregister(ctl); + camera_device_unregister(s); return rval; }