]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
V4L: Int if: Set slave's master before attach, remove master argument
authorSakari Ailus <sakari.ailus@nokia.com>
Tue, 16 Oct 2007 15:08:27 +0000 (18:08 +0300)
committerTony Lindgren <tony@atomide.com>
Wed, 31 Oct 2007 12:48:53 +0000 (05:48 -0700)
Set slave's master before master's attach call.

The master also now gets its own pointer from slave's structure.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/media/video/v4l2-int-device.c
include/media/v4l2-int-device.h

index 8b4ef530a3a8a60c58013e5a865efaac9776d578..a545dcaf857f72ee646405aeffff9ced4a3fedd8 100644 (file)
@@ -57,12 +57,12 @@ static void v4l2_int_device_try_attach_all(void)
                        if (!try_module_get(m->module))
                                continue;
 
-                       if (m->u.master->attach(m, s)) {
+                       s->u.slave->master = m;
+                       if (m->u.master->attach(s)) {
+                               s->u.slave->master = NULL;
                                module_put(m->module);
                                continue;
                        }
-
-                       s->u.slave->master = m;
                }
        }
 }
index 066ebfc4f9832e89805b42d0ccbacae6112783c1..c8b80e0f065199e01102933d0ad4074075632782 100644 (file)
@@ -44,9 +44,8 @@ enum v4l2_int_type {
 struct v4l2_int_device;
 
 struct v4l2_int_master {
-       int (*attach)(struct v4l2_int_device *master,
-                     struct v4l2_int_device *slave);
-       void (*detach)(struct v4l2_int_device *master);
+       int (*attach)(struct v4l2_int_device *slave);
+       void (*detach)(struct v4l2_int_device *slave);
 };
 
 typedef int (v4l2_int_ioctl_func)(struct v4l2_int_device *);