mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Al Cooper <alcooperx@gmail.com>,
	Broadcom internal kernel review list 
	<bcm-kernel-feedback-list@broadcom.com>,
	Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH v1 1/1] serial: 8250_bcm7271: Use dev_err_probe() instead of dev_err()
Date: Tue, 12 Sep 2023 20:20:49 +0200	[thread overview]
Message-ID: <412c5225-e9c0-6a8d-1b39-2ce60cbf8074@wanadoo.fr> (raw)
In-Reply-To: <20230912165550.402540-1-andriy.shevchenko@linux.intel.com>

Le 12/09/2023 à 18:55, Andy Shevchenko a écrit :
> Make the error messages format unified by switching to use
> dev_err_probe() where it makes sense.
> 
> This also helps simplifing the code.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/tty/serial/8250/8250_bcm7271.c | 17 +++++++----------
>   1 file changed, 7 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_bcm7271.c b/drivers/tty/serial/8250/8250_bcm7271.c
> index aa5aff046756..51c3eca8673c 100644
> --- a/drivers/tty/serial/8250/8250_bcm7271.c
> +++ b/drivers/tty/serial/8250/8250_bcm7271.c
> @@ -984,10 +984,9 @@ static int brcmuart_probe(struct platform_device *pdev)
>   	}
>   
>   	/* We should have just the uart base registers or all the registers */
> -	if (x != 1 && x != REGS_MAX) {
> -		dev_warn(dev, "%s registers not specified\n", reg_names[x]);
> -		return -EINVAL;
> -	}
> +	if (x != 1 && x != REGS_MAX)
> +		return dev_err_probe(dev, -EINVAL, "%s registers not specified\n",
> +				     reg_names[x]);
>   
>   	/* if the DMA registers were specified, try to enable DMA */
>   	if (x > REGS_DMA_RX) {
> @@ -1034,8 +1033,7 @@ static int brcmuart_probe(struct platform_device *pdev)
>   	}
>   
>   	if (clk_rate == 0) {
> -		dev_err(dev, "clock-frequency or clk not defined\n");
> -		ret = -EINVAL;
> +		ret = dev_err_probe(dev, -EINVAL, "clock-frequency or clk not defined\n");
>   		goto err_clk_disable;
>   	}
>   
> @@ -1093,7 +1091,7 @@ static int brcmuart_probe(struct platform_device *pdev)
>   
>   	ret = serial8250_register_8250_port(&up);
>   	if (ret < 0) {
> -		dev_err(dev, "unable to register 8250 port\n");
> +		dev_err_probe(dev, ret, "unable to register 8250 port\n");
>   		goto err;
>   	}
>   	priv->line = ret;
> @@ -1102,14 +1100,13 @@ static int brcmuart_probe(struct platform_device *pdev)
>   	if (priv->dma_enabled) {
>   		dma_irq = platform_get_irq_byname(pdev,  "dma");
>   		if (dma_irq < 0) {
> -			ret = dma_irq;
> -			dev_err(dev, "no IRQ resource info\n");
> +			dev_err_probe(dev, dma_irq, "no IRQ resource info\n");

ret = dev_err_probe(dev, dma_irq, "no IRQ resource info\n");

>   			goto err1;
>   		}
>   		ret = devm_request_irq(dev, dma_irq, brcmuart_isr,
>   				IRQF_SHARED, "uart DMA irq", &new_port->port);
>   		if (ret) {
> -			dev_err(dev, "unable to register IRQ handler\n");
> +			dev_err_probe(dev, ret, "unable to register IRQ handler\n");
>   			goto err1;
>   		}
>   	}


  reply	other threads:[~2023-09-12 18:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-12 16:55 Andy Shevchenko
2023-09-12 18:20 ` Christophe JAILLET [this message]
2023-09-13 11:12   ` Andy Shevchenko

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=412c5225-e9c0-6a8d-1b39-2ce60cbf8074@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=alcooperx@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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®