summaryrefslogtreecommitdiffstats
path: root/drivers/rpmsg
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2016-10-08 06:23:12 +0200
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-10-31 23:41:46 +0100
commite950604782440c8635d289552bb5db58658fcbe9 (patch)
treeae586b92909250b6247cec27f3856e4297f98f04 /drivers/rpmsg
parentrpmsg: smd: Reduce restrictions when finding channel (diff)
downloadlinux-e950604782440c8635d289552bb5db58658fcbe9.tar.xz
linux-e950604782440c8635d289552bb5db58658fcbe9.zip
rpmsg: Introduce a driver override mechanism
Similar to other subsystems it's useful to provide a mechanism to force a specific driver match on a device, so introduce this. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/rpmsg')
-rw-r--r--drivers/rpmsg/rpmsg_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index b6ea9ffa7381..087d4db896c8 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -315,6 +315,9 @@ 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 (rpdev->driver_override)
+ return !strcmp(rpdev->driver_override, drv->name);
+
if (ids)
for (i = 0; ids[i].name[0]; i++)
if (rpmsg_id_match(rpdev, &ids[i]))