diff options
author | Tudor Ambarus <tudor.ambarus@linaro.org> | 2025-02-24 11:27:14 +0300 |
---|---|---|
committer | Jassi Brar <jassisinghbrar@gmail.com> | 2025-03-27 04:58:25 +0300 |
commit | 8c71c61fc613657d785a3377b4b34484bd978374 (patch) | |
tree | 57d368881c48268e2a76c21a4190b6405f9d4f1b | |
parent | 24fdd5074b205cfb0ef4cd0751a2d03031455929 (diff) | |
download | linux-8c71c61fc613657d785a3377b4b34484bd978374.tar.xz |
mailbox: don't protect of_parse_phandle_with_args with con_mutex
There are no concurrency problems if multiple consumers parse the
phandle, don't gratuiously protect the parsing with the mutex used
for the controllers list.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
-rw-r--r-- | drivers/mailbox/mailbox.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index cb174e788a96..784b56859a06 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -413,16 +413,15 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index) return ERR_PTR(-ENODEV); } - mutex_lock(&con_mutex); - ret = of_parse_phandle_with_args(dev->of_node, "mboxes", "#mbox-cells", index, &spec); if (ret) { dev_dbg(dev, "%s: can't parse \"mboxes\" property\n", __func__); - mutex_unlock(&con_mutex); return ERR_PTR(ret); } + mutex_lock(&con_mutex); + chan = ERR_PTR(-EPROBE_DEFER); list_for_each_entry(mbox, &mbox_cons, node) if (mbox->dev->of_node == spec.np) { |