[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <21435bc6-d4d7-4576-8ff6-266ce9507799@suswa.mountain>
Date: Thu, 15 May 2025 16:16:28 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: long.yunjian@....com.cn
Cc: sudeep.holla@....com, cristian.marussi@....com, peng.fan@....com,
justin.chen@...adcom.com, florian.fainelli@...adcom.com,
arm-scmi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, fang.yumeng@....com.cn,
mou.yi@....com.cn, ouyang.maochun@....com.cn, xu.lifeng1@....com.cn
Subject: Re: [PATCH] firmware: arm_scmi: Use dev_err_probe() simplify the code
On Thu, May 15, 2025 at 08:38:55PM +0800, long.yunjian@....com.cn wrote:
> From: Yumeng Fang <fang.yumeng@....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@....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
Powered by blists - more mailing lists