Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c94a674 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

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: default avatarSakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 53133afb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
		}
	}
}
+2 −3
Original line number Diff line number Diff line
@@ -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 *);