]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP2: Camera: Fix v4l2 int device detach
authorSakari Ailus <sakari.ailus@nokia.com>
Tue, 16 Oct 2007 15:08:28 +0000 (18:08 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 31 Oct 2007 12:49:07 +0000 (05:49 -0700)
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 <sakari.ailus@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/media/video/omap24xxcam.c

index 7da1668384e9d5e0c6db9521fac12b53459ed193..8fda9e1c2a71e5c09179bb7dc9eca70f0b4b7c41 100644 (file)
@@ -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);