summaryrefslogtreecommitdiff
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorMikko Perttunen <mperttunen@nvidia.com>2018-11-28 12:54:11 +0300
committerJassi Brar <jaswinder.singh@linaro.org>2018-12-22 07:31:26 +0300
commit8ed82e23875e6014d9aa8e03bf4301b27d614050 (patch)
treeae6158c64bafc3dd1ec8b0ade1dfbb6ca848b4d6 /drivers/mailbox
parenta8803d7421cc2be2ac12a8155e5d824f04259eff (diff)
downloadlinux-8ed82e23875e6014d9aa8e03bf4301b27d614050.tar.xz
mailbox: Allow multiple controllers per device
Look through the whole controller list when mapping device tree phandles to controllers instead of stopping at the first one. Each controller is intended to only contain one kind of mailbox, but some devices (like Tegra HSP) implement multiple kinds and use the same device tree node for all of them. As such, we need to allow multiple mbox_controllers per device tree node. Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/mailbox.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 6abb35ff49fa..c6a7d4582dc6 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -355,7 +355,8 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
list_for_each_entry(mbox, &mbox_cons, node)
if (mbox->dev->of_node == spec.np) {
chan = mbox->of_xlate(mbox, &spec);
- break;
+ if (!IS_ERR(chan))
+ break;
}
of_node_put(spec.np);