mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
rpmsg: qcom_smd: Improve error handling for qcom_smd_parse_edge
When the mailbox driver has not probed yet, the error message "failed to parse smd edge" is just going to confuse users, so improve the error prints a bit. Cover the last remaining exits from qcom_smd_parse_edge with proper error prints, especially the one for the mbox_chan deserved dev_err_probe to handle EPROBE_DEFER nicely. And add one for ipc_regmap also to be complete. With this done, we can remove the outer print completely. Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Luca Weiss <luca@lucaweiss.eu> Link: https://lore.kernel.org/r/20250326-apcs-mboxes-v3-1-e20f39e125f2@lucaweiss.eu Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
3a70b945d3
commit
75499b3232
@@ -1369,7 +1369,8 @@ static int qcom_smd_parse_edge(struct device *dev,
|
||||
edge->mbox_chan = mbox_request_channel(&edge->mbox_client, 0);
|
||||
if (IS_ERR(edge->mbox_chan)) {
|
||||
if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
|
||||
ret = PTR_ERR(edge->mbox_chan);
|
||||
ret = dev_err_probe(dev, PTR_ERR(edge->mbox_chan),
|
||||
"failed to acquire IPC mailbox\n");
|
||||
goto put_node;
|
||||
}
|
||||
|
||||
@@ -1386,6 +1387,7 @@ static int qcom_smd_parse_edge(struct device *dev,
|
||||
of_node_put(syscon_np);
|
||||
if (IS_ERR(edge->ipc_regmap)) {
|
||||
ret = PTR_ERR(edge->ipc_regmap);
|
||||
dev_err(dev, "failed to get regmap from syscon: %d\n", ret);
|
||||
goto put_node;
|
||||
}
|
||||
|
||||
@@ -1501,10 +1503,8 @@ struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
|
||||
}
|
||||
|
||||
ret = qcom_smd_parse_edge(&edge->dev, node, edge);
|
||||
if (ret) {
|
||||
dev_err(&edge->dev, "failed to parse smd edge\n");
|
||||
if (ret)
|
||||
goto unregister_dev;
|
||||
}
|
||||
|
||||
ret = qcom_smd_create_chrdev(edge);
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user