]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP1: Camera: Fix v4l2 int device detach
authorEduardo Valentin <eduardo.valentin@indt.org.br>
Wed, 21 Nov 2007 22:23:04 +0000 (18:23 -0400)
committerTony Lindgren <tony@atomide.com>
Wed, 28 Nov 2007 02:23:26 +0000 (18:23 -0800)
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 <eduardo.valentin@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/media/video/omap/camera_core.c

index 6e5d8bdf33e10deb506d1ae766e37662808e31a9..be033bea2866160c7d5fb6ddff2f429260409ac5 100644 (file)
@@ -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;
 }