Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Mikko Perttunen and committed by
Jassi Brar
8ed82e23 a8803d74

+2 -1
+2 -1
drivers/mailbox/mailbox.c
··· 355 355 list_for_each_entry(mbox, &mbox_cons, node) 356 356 if (mbox->dev->of_node == spec.np) { 357 357 chan = mbox->of_xlate(mbox, &spec); 358 - break; 358 + if (!IS_ERR(chan)) 359 + break; 359 360 } 360 361 361 362 of_node_put(spec.np);