Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (6580): Set slave's master before master's attach call.

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>

authored by

Sakari Ailus and committed by
Mauro Carvalho Chehab
2c94a674 53133afb

+5 -6
+3 -3
drivers/media/video/v4l2-int-device.c
··· 57 57 if (!try_module_get(m->module)) 58 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 63 module_put(m->module); 62 64 continue; 63 65 } 64 - 65 - s->u.slave->master = m; 66 66 } 67 67 } 68 68 }
+2 -3
include/media/v4l2-int-device.h
··· 44 44 struct v4l2_int_device; 45 45 46 46 struct v4l2_int_master { 47 - int (*attach)(struct v4l2_int_device *master, 48 - struct v4l2_int_device *slave); 49 - void (*detach)(struct v4l2_int_device *master); 47 + int (*attach)(struct v4l2_int_device *slave); 48 + void (*detach)(struct v4l2_int_device *slave); 50 49 }; 51 50 52 51 typedef int (v4l2_int_ioctl_func)(struct v4l2_int_device *);