From: Mikko Perttunen Date: Wed, 28 Nov 2018 09:54:11 +0000 (+0100) Subject: mailbox: Allow multiple controllers per device X-Git-Tag: v5.15~7259^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8ed82e23875e6014d9aa8e03bf4301b27d614050;p=platform%2Fkernel%2Flinux-starfive.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 6abb35f..c6a7d45 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);