From: Dan Carpenter <dan.carpenter@linaro.org>
To: long.yunjian@zte.com.cn
Cc: sudeep.holla@arm.com, cristian.marussi@arm.com, peng.fan@nxp.com,
justin.chen@broadcom.com, florian.fainelli@broadcom.com,
arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, fang.yumeng@zte.com.cn,
mou.yi@zte.com.cn, ouyang.maochun@zte.com.cn,
xu.lifeng1@zte.com.cn
Subject: Re: [PATCH] firmware: arm_scmi: Use dev_err_probe() simplify the code
Date: Thu, 15 May 2025 16:16:28 +0300 [thread overview]
Message-ID: <21435bc6-d4d7-4576-8ff6-266ce9507799@suswa.mountain> (raw)
In-Reply-To: <20250515203855146Sn9x-Uw9Teur35mOjn41C@zte.com.cn>
On Thu, May 15, 2025 at 08:38:55PM +0800, long.yunjian@zte.com.cn wrote:
> From: Yumeng Fang <fang.yumeng@zte.com.cn>
>
> 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: Yumeng Fang <fang.yumeng@zte.com.cn>
When you're resending someone else's patch you need to add your own
Signed-off-by: line to the end of the list.
Please, could you resend a v2 patch with your signature?
> ---
> drivers/firmware/arm_scmi/transports/mailbox.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/firmware/arm_scmi/transports/mailbox.c b/drivers/firmware/arm_scmi/transports/mailbox.c
> index bd041c99b92b..816e79537935 100644
> --- a/drivers/firmware/arm_scmi/transports/mailbox.c
> +++ b/drivers/firmware/arm_scmi/transports/mailbox.c
> @@ -13,6 +13,7 @@
> #include <linux/of_address.h>
> #include <linux/platform_device.h>
> #include <linux/slab.h>
> +#include <linux/dev_printk.h>
>
> #include "../common.h"
>
> @@ -215,10 +216,8 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev,
> smbox->chan = mbox_request_channel(cl, tx ? 0 : p2a_chan);
> if (IS_ERR(smbox->chan)) {
> ret = PTR_ERR(smbox->chan);
> - if (ret != -EPROBE_DEFER)
> - dev_err(cdev,
> - "failed to request SCMI %s mailbox\n", desc);
> - return ret;
> + return dev_err_probe(cdev, ret,
It's probably better to get rid of the "ret = PTR_ERR(smbox->chan);"
assignment as well. Then it's a one liner:
if (IS_ERR(smbox->chan))
return dev_err_probe(cdev, PTR_ERR(smbox->chan),
"failed to request SCMI %s mailbox\n", desc);
Same for the others as well.
regards,
dan carpenter
next prev parent reply other threads:[~2025-05-15 13:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 12:38 long.yunjian
2025-05-15 13:16 ` Dan Carpenter [this message]
2025-05-15 13:59 ` Cristian Marussi
2025-05-16 8:02 ` Dan Carpenter
2025-05-16 15:23 ` Christophe JAILLET
2025-05-16 15:25 ` Christophe JAILLET
2025-05-21 7:59 ` long.yunjian
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=21435bc6-d4d7-4576-8ff6-266ce9507799@suswa.mountain \
--to=dan.carpenter@linaro.org \
--cc=arm-scmi@vger.kernel.org \
--cc=cristian.marussi@arm.com \
--cc=fang.yumeng@zte.com.cn \
--cc=florian.fainelli@broadcom.com \
--cc=justin.chen@broadcom.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=long.yunjian@zte.com.cn \
--cc=mou.yi@zte.com.cn \
--cc=ouyang.maochun@zte.com.cn \
--cc=peng.fan@nxp.com \
--cc=sudeep.holla@arm.com \
--cc=xu.lifeng1@zte.com.cn \
/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
all inboxes | Powered by JetHome®