From: Mikko Perttunen Date: Wed, 28 Nov 2018 09:54:11 +0000 (+0100) Subject: mailbox: Allow multiple controllers per device X-Git-Tag: v5.0-rc1~56^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ed82e23875e6014d9aa8e03bf4301b27d614050;p=thirdparty%2Flinux.git 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 Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 6abb35ff49fa1..c6a7d4582dc67 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);