[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAfSe-vaCg7KVQfuNshs8g-dyXxVGEChvGdaxNOyK6qay65qYA@mail.gmail.com>
Date: Thu, 27 Aug 2020 10:01:43 +0800
From: Chunyan Zhang <zhang.lyra@...il.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, Lee Jones <lee.jones@...aro.org>,
Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
Florian Fainelli <f.fainelli@...il.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
bcm-kernel-feedback-list@...adcom.com,
Paul Cercueil <paul@...pouillou.net>,
Heiko Stuebner <heiko@...ech.de>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Orson Zhai <orsonzhai@...il.com>,
Baolin Wang <baolin.wang7@...il.com>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>, linux-pwm@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-rockchip@...ts.infradead.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH 5/6] pwm: sprd: Simplify with dev_err_probe()
On Wed, 26 Aug 2020 at 22:48, Krzysztof Kozlowski <krzk@...nel.org> wrote:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and also it prints the error value.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@...nel.org>
Acked-by: Chunyan Zhang <zhang.lyra@...il.com>
Thanks!
> ---
> drivers/pwm/pwm-sprd.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c
> index be2394227423..5123d948efd6 100644
> --- a/drivers/pwm/pwm-sprd.c
> +++ b/drivers/pwm/pwm-sprd.c
> @@ -228,11 +228,8 @@ static int sprd_pwm_clk_init(struct sprd_pwm_chip *spc)
> if (ret == -ENOENT)
> break;
>
> - if (ret != -EPROBE_DEFER)
> - dev_err(spc->dev,
> - "failed to get channel clocks\n");
> -
> - return ret;
> + return dev_err_probe(spc->dev, ret,
> + "failed to get channel clocks\n");
> }
>
> clk_pwm = chn->clks[SPRD_PWM_CHN_OUTPUT_CLK].clk;
> --
> 2.17.1
>
Powered by blists - more mailing lists