The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Yu Jiaoliang <yujiaoliang@vivo.com>,
	Jacky Huang <ychuang3@nuvoton.com>,
	Shan-Chun Hung <schung@nuvoton.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH v1] tty: serial: ma35d1: Simplify with dev_err_probe()
Date: Fri, 30 Aug 2024 10:07:19 +0200	[thread overview]
Message-ID: <650ec430-715a-41d5-bbac-15dece73c632@kernel.org> (raw)
In-Reply-To: <20240829085316.3144246-1-yujiaoliang@vivo.com>

On 29/08/2024 10:53, Yu Jiaoliang wrote:
> Error handling in probe() can be a bit simpler with dev_err_probe().
> 
> Signed-off-by: Yu Jiaoliang <yujiaoliang@vivo.com>
> ---
>  drivers/tty/serial/ma35d1_serial.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c
> index 3b4206e815fe..09d42a4054b3 100644
> --- a/drivers/tty/serial/ma35d1_serial.c
> +++ b/drivers/tty/serial/ma35d1_serial.c
> @@ -692,10 +692,9 @@ static int ma35d1serial_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  
>  	ret = of_alias_get_id(pdev->dev.of_node, "serial");
> -	if (ret < 0) {
> -		dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret);
> -		return ret;
> -	}
> +	if (ret < 0)
> +		return dev_err_probe(&pdev->dev, ret, "failed to get alias/pdev id\n");

This is kind of silly... You change part which cannot defer, but you
leave second dev_err() intact which actually would benefit from handling
defer and dev_err_probe().

You either do not understand the function at all or you split patches in
some artificial, fake way just to generate multiple patches.

That's pointless.

Best regards,
Krzysztof


      reply	other threads:[~2024-08-30  8:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29  8:53 [PATCH v1] tty: serial: ma35d1: Simplify with dev_err_probe() Yu Jiaoliang
2024-08-30  8:07 ` Krzysztof Kozlowski [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=650ec430-715a-41d5-bbac-15dece73c632@kernel.org \
    --to=krzk@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=opensource.kernel@vivo.com \
    --cc=schung@nuvoton.com \
    --cc=ychuang3@nuvoton.com \
    --cc=yujiaoliang@vivo.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