From ed351ee74351d53859d47983fad7f1b29265554e Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Tue, 16 Oct 2007 18:08:27 +0300 Subject: [PATCH] V4L: Int if: Set slave's master before attach, remove master argument 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 Signed-off-by: Tony Lindgren --- drivers/media/video/v4l2-int-device.c | 6 +++--- include/media/v4l2-int-device.h | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c index 8b4ef530a3a..a545dcaf857 100644 --- a/drivers/media/video/v4l2-int-device.c +++ b/drivers/media/video/v4l2-int-device.c @@ -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; } } } diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index 066ebfc4f98..c8b80e0f065 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h @@ -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 *); -- 2.41.1