diff options
| author | Ibai Erkiaga <[email protected]> | 2019-09-27 11:36:55 +0100 |
|---|---|---|
| committer | Michal Simek <[email protected]> | 2019-10-08 09:55:11 +0200 |
| commit | 05f683a3e2dea5e0700fd1e7b540ae024135545a (patch) | |
| tree | fe33ee55d1040f5968d01b546da9f8ffb24f606f | |
| parent | 22673b4d53fc5ad82f632d6cdaae2950190ef214 (diff) | |
mailbox: allow subnode for mbox regs
The following patch allows the mailbox node in DT to host subnodes with
mailbox definitions. If the client phandle to the mailbox is not the
mailbox driver node, just checks parents as well.
Signed-off-by: Ibai Erkiaga <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
| -rw-r--r-- | drivers/mailbox/mailbox-uclass.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mailbox/mailbox-uclass.c b/drivers/mailbox/mailbox-uclass.c index 809f26b2025..9fdb6279e4f 100644 --- a/drivers/mailbox/mailbox-uclass.c +++ b/drivers/mailbox/mailbox-uclass.c @@ -49,7 +49,16 @@ int mbox_get_by_index(struct udevice *dev, int index, struct mbox_chan *chan) if (ret) { debug("%s: uclass_get_device_by_of_offset failed: %d\n", __func__, ret); - return ret; + + /* Test with parent node */ + ret = uclass_get_device_by_ofnode(UCLASS_MAILBOX, + ofnode_get_parent(args.node), + &dev_mbox); + if (ret) { + debug("%s: mbox node from parent failed: %d\n", + __func__, ret); + return ret; + }; } ops = mbox_dev_ops(dev_mbox); |
