From 7884528e07533a355d998f83e993dca0ed88b68f Mon Sep 17 00:00:00 2001 From: Eduardo Valentin Date: Wed, 21 Nov 2007 18:23:04 -0400 Subject: [PATCH] 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 --- drivers/media/video/omap/camera_core.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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; } -- 2.41.1