On Wed, Apr 24, 2024 at 06:23:54PM +0200, Luca Weiss wrote:
> When the mailbox driver has not probed yet, skip printing the error
> message since it's just going to confuse users.
> 
> Signed-off-by: Luca Weiss <l...@z3ntu.xyz>
> ---
>  drivers/rpmsg/qcom_smd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index 43f601c84b4f..6fc299657adf 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -1502,7 +1502,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 != -EPROBE_DEFER)
> +                     dev_err(&edge->dev, "failed to parse smd edge\n");

In the described case, this error message would not be entirely
accurate, and the cause is not accurately captured in devices_deferred.

Unless I'm mistaken, it seems like qcom_smd_parse_edge() will also print
a more useful error in every other case, except after the mbox_chan !=
-ENODEV check..

How about making that:

        if (PTR_ERR(edge->mbox_chan) != -ENODEV) {
                ret = dev_err_probe(dev, PTR_ERR(edge->mbox_chan),
                                    "failed to acquire IPC mailbox\n");
                goto put_node;
        }

And then drop the error print here in qcom_smd_register_edge().

It would bring us the devices_deferred tracking, and it would avoid the
double print in all other cases.

Regards,
Bjorn

>               goto unregister_dev;
>       }
>  
> 
> -- 
> 2.44.0
> 

Reply via email to