[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220214134850.aqmd7wjxjsjyuwz7@pengutronix.de>
Date: Mon, 14 Feb 2022 14:48:50 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Cc: thierry.reding@...il.com, lee.jones@...aro.org,
matthias.bgg@...il.com, linux-pwm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, kernel@...labora.com
Subject: Re: [PATCH 1/2] pwm: pwm-mediatek: Simplify error handling with
dev_err_probe()
On Mon, Feb 14, 2022 at 12:30:37PM +0100, AngeloGioacchino Del Regno wrote:
> Use dev_err_probe() to simplify handling errors in pwm_mediatek_probe().
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
> drivers/pwm/pwm-mediatek.c | 30 +++++++++++-------------------
> 1 file changed, 11 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/pwm/pwm-mediatek.c b/drivers/pwm/pwm-mediatek.c
> index 0d4dd80e9f07..c7d5ca09a684 100644
> --- a/drivers/pwm/pwm-mediatek.c
> +++ b/drivers/pwm/pwm-mediatek.c
> @@ -227,18 +227,14 @@ static int pwm_mediatek_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> pc->clk_top = devm_clk_get(&pdev->dev, "top");
> - if (IS_ERR(pc->clk_top)) {
> - dev_err(&pdev->dev, "clock: top fail: %ld\n",
> - PTR_ERR(pc->clk_top));
> - return PTR_ERR(pc->clk_top);
> - }
> + if (IS_ERR(pc->clk_top))
> + return dev_err_probe(&pdev->dev, PTR_ERR(pc->clk_top),
> + "clock: top failed\n");
The change looks straight forward. I wonder if we should improve the
error message on this occasion. E.g.
"Failed to get top clock\n"
? Ditto below.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists