[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1jsgbuaszx.fsf@starbuckisacylon.baylibre.com>
Date: Mon, 07 Sep 2020 10:30:42 +0200
From: Jerome Brunet <jbrunet@...libre.com>
To: Krzysztof Kozlowski <krzk@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Ludovic Desroches <ludovic.desroches@...rochip.com>,
David Lechner <david@...hnology.com>,
Sekhar Nori <nsekhar@...com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Neil Armstrong <narmstrong@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-amlogic@...ts.infradead.org, linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH 07/10] clk: meson: Simplify with dev_err_probe()
On Wed 02 Sep 2020 at 17:03, Krzysztof Kozlowski <krzk@...nel.org> 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@...nel.org>
Acked-by: Jerome Brunet <jbrunet@...libre.com>
> ---
> drivers/clk/meson/axg-audio.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c
> index 53715e36326c..dc22b0c45743 100644
> --- a/drivers/clk/meson/axg-audio.c
> +++ b/drivers/clk/meson/axg-audio.c
> @@ -1509,12 +1509,8 @@ static int devm_clk_get_enable(struct device *dev, char *id)
> int ret;
>
> clk = devm_clk_get(dev, id);
> - if (IS_ERR(clk)) {
> - ret = PTR_ERR(clk);
> - if (ret != -EPROBE_DEFER)
> - dev_err(dev, "failed to get %s", id);
> - return ret;
> - }
> + if (IS_ERR(clk))
> + return dev_err_probe(dev, PTR_ERR(clk), "failed to get %s", id);
>
> ret = clk_prepare_enable(clk);
> if (ret) {
Powered by blists - more mailing lists