lkml.org 
[lkml]   [2020]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] serial: 8250: Simplify with dev_err_probe()
From
Date


On 9/1/2020 8:30 AM, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
> drivers/tty/serial/8250/8250_bcm2835aux.c | 12 +++---------
> drivers/tty/serial/8250/8250_ingenic.c | 20 ++++++--------------
> 2 files changed, 9 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c
> index 12d03e678295..fd95860cd661 100644
> --- a/drivers/tty/serial/8250/8250_bcm2835aux.c
> +++ b/drivers/tty/serial/8250/8250_bcm2835aux.c
> @@ -110,12 +110,8 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
>
> /* get the clock - this also enables the HW */
> data->clk = devm_clk_get(&pdev->dev, NULL);
> - ret = PTR_ERR_OR_ZERO(data->clk);
> - if (ret) {
> - if (ret != -EPROBE_DEFER)
> - dev_err(&pdev->dev, "could not get clk: %d\n", ret);
> - return ret;
> - }
> + if (IS_ERR(data->clk))
> + return dev_err_probe(&pdev->dev, PTR_ERR(data->clk), "could not get clk\n");

For 8250_bcm2835aux.c:

Acked-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian

\
 
 \ /
  Last update: 2020-09-01 18:11    [W:0.066 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site