From: Cristian Marussi <cristian.marussi@arm.com>
To: Yuan Can <yuancan@huawei.com>
Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] firmware: arm_scmi: Use dev_err_probe() to simplify code
Date: Mon, 26 Sep 2022 11:50:26 +0100 [thread overview]
Message-ID: <YzGD8qSE2CDRKC2X@e120937-lin> (raw)
In-Reply-To: <20220924025146.34976-1-yuancan@huawei.com>
On Sat, Sep 24, 2022 at 02:51:46AM +0000, Yuan Can wrote:
> In the probe path, dev_err() can be replaced with dev_err_probe()
> which will check if error code is -EPROBE_DEFER and prints the
> error name. It also sets the defer probe reason which can be
> checked later through debugfs.
>
> Signed-off-by: Yuan Can <yuancan@huawei.com>
Hi Yuan,
LGTM, thanks for this.
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Thanks,
Cristian
> ---
> drivers/firmware/arm_scmi/mailbox.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c
> index 08ff4d110beb..85b84be85458 100644
> --- a/drivers/firmware/arm_scmi/mailbox.c
> +++ b/drivers/firmware/arm_scmi/mailbox.c
> @@ -94,13 +94,10 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
> cl->knows_txdone = tx;
>
> smbox->chan = mbox_request_channel(cl, tx ? 0 : 1);
> - if (IS_ERR(smbox->chan)) {
> - ret = PTR_ERR(smbox->chan);
> - if (ret != -EPROBE_DEFER)
> - dev_err(cdev, "failed to request SCMI %s mailbox\n",
> - tx ? "Tx" : "Rx");
> - return ret;
> - }
> + if (IS_ERR(smbox->chan))
> + return dev_err_probe(cdev, PTR_ERR(smbox->chan),
> + "failed to request SCMI %s mailbox\n",
> + tx ? "Tx" : "Rx");
>
> cinfo->transport_info = smbox;
> smbox->cinfo = cinfo;
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-09-26 10:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 2:51 [PATCH] firmware: arm_scmi: Use dev_err_probe() to simplify code Yuan Can
2022-09-26 10:50 ` Cristian Marussi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YzGD8qSE2CDRKC2X@e120937-lin \
--to=cristian.marussi@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=sudeep.holla@arm.com \
--cc=yuancan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox