V4L/DVB (6580): Set slave's master before master's attach call.
authorSakari Ailus <sakari.ailus@nokia.com>
Tue, 30 Oct 2007 08:52:52 +0000 (05:52 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 25 Jan 2008 21:02:06 +0000 (19:02 -0200)
V4L: Int if: Set slave's master before attach, remove master argument

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

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
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 *);