From: Peng Fan Date: Fri, 11 Apr 2025 13:14:11 +0000 (+0800) Subject: mailbox: Propagate correct error return value X-Git-Tag: v6.16-rc1~84^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb7e2ec3706f7ddedde2504b1b4342046c9a92e3;p=thirdparty%2Flinux.git mailbox: Propagate correct error return value In case of_property_match_string fails, it makes more sense to return its error value to caller, not force the value to ERR_PTR(-EINVAL). Signed-off-by: Peng Fan Signed-off-by: Jassi Brar --- diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 3ecf92a580fef..3a58dc56f015b 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -458,7 +458,7 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl, if (index < 0) { dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n", __func__, name); - return ERR_PTR(-EINVAL); + return ERR_PTR(index); } return mbox_request_channel(cl, index); }