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>
This commit is contained in:
Bjorn Andersson
2016-10-07 21:23:12 -07:00
parent 66dca399e6
commit e950604782
2 changed files with 5 additions and 0 deletions

View File

@@ -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]))