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

Commit a16644cb authored by Bjorn Andersson's avatar Bjorn Andersson
Browse files

rpmsg: Enable matching devices with drivers based on DT



Make it possible to match rpmsg devices based on device tree node, in
addition to the id table. In some of these cases the rpmsg driver would
not have a id_table, so make this optional.

Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 4851b1b2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <linux/wait.h>
#include <linux/rpmsg.h>
#include <linux/mutex.h>
#include <linux/of_device.h>

/**
 * struct virtproc_info - virtual remote processor state
@@ -175,11 +176,12 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv)
	const struct rpmsg_device_id *ids = rpdrv->id_table;
	unsigned int i;

	if (ids)
		for (i = 0; ids[i].name[0]; i++)
			if (rpmsg_id_match(rpdev, &ids[i]))
				return 1;

	return 0;
	return of_driver_match_device(dev, drv);
}

static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env)