summaryrefslogtreecommitdiff
path: root/drivers/mailbox
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@linaro.org>2025-02-24 08:27:13 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-04 14:41:54 +0200
commit09096ead92f39292267ab10113e4c7df4b9ed3f7 (patch)
tree39132db24a0067490df879906cf078c14a8d652c /drivers/mailbox
parent5641f6b3a4cd5672fbc94f7899d51bb21eb87da4 (diff)
downloadlinux-09096ead92f39292267ab10113e4c7df4b9ed3f7.tar.gz
linux-09096ead92f39292267ab10113e4c7df4b9ed3f7.tar.bz2
linux-09096ead92f39292267ab10113e4c7df4b9ed3f7.zip
mailbox: use error ret code of of_parse_phandle_with_args()
[ Upstream commit 24fdd5074b205cfb0ef4cd0751a2d03031455929 ] In case of error, of_parse_phandle_with_args() returns -EINVAL when the passed index is negative, or -ENOENT when the index is for an empty phandle. The mailbox core overwrote the error return code with a less precise -ENODEV. Use the error returned code from of_parse_phandle_with_args(). Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/mailbox.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index ebff3baf3045..f13d705f7861 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -415,11 +415,12 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
mutex_lock(&con_mutex);
- if (of_parse_phandle_with_args(dev->of_node, "mboxes",
- "#mbox-cells", index, &spec)) {
+ 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(-ENODEV);
+ return ERR_PTR(ret);
}
chan = ERR_PTR(-EPROBE_DEFER);