diff options
-rw-r--r-- | drivers/media/video/v4l2-int-device.c | 6 | ||||
-rw-r--r-- | 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 8b4ef530a3a8..a545dcaf857f 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) | |||
57 | if (!try_module_get(m->module)) | 57 | if (!try_module_get(m->module)) |
58 | continue; | 58 | continue; |
59 | 59 | ||
60 | if (m->u.master->attach(m, s)) { | 60 | s->u.slave->master = m; |
61 | if (m->u.master->attach(s)) { | ||
62 | s->u.slave->master = NULL; | ||
61 | module_put(m->module); | 63 | module_put(m->module); |
62 | continue; | 64 | continue; |
63 | } | 65 | } |
64 | |||
65 | s->u.slave->master = m; | ||
66 | } | 66 | } |
67 | } | 67 | } |
68 | } | 68 | } |
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h index 066ebfc4f983..c8b80e0f0651 100644 --- a/include/media/v4l2-int-device.h +++ b/include/media/v4l2-int-device.h | |||
@@ -44,9 +44,8 @@ enum v4l2_int_type { | |||
44 | struct v4l2_int_device; | 44 | struct v4l2_int_device; |
45 | 45 | ||
46 | struct v4l2_int_master { | 46 | struct v4l2_int_master { |
47 | int (*attach)(struct v4l2_int_device *master, | 47 | int (*attach)(struct v4l2_int_device *slave); |
48 | struct v4l2_int_device *slave); | 48 | void (*detach)(struct v4l2_int_device *slave); |
49 | void (*detach)(struct v4l2_int_device *master); | ||
50 | }; | 49 | }; |
51 | 50 | ||
52 | typedef int (v4l2_int_ioctl_func)(struct v4l2_int_device *); | 51 | typedef int (v4l2_int_ioctl_func)(struct v4l2_int_device *); |