Re: [PATCH next] pwm: loongson: Fix an error code in probe()

From: Uwe Kleine-König
Date: Wed Apr 16 2025 - 01:24:31 EST


Hello Dan,

On Wed, Apr 09, 2025 at 02:00:20PM +0300, Dan Carpenter wrote:
> There is a copy and paste bug so we accidentally returned
> PTR_ERR(ddata->clk) instead of "ret".
>
> Fixes: 322fc380cea1 ("pwm: Add Loongson PWM controller support")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> drivers/pwm/pwm-loongson.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/pwm-loongson.c b/drivers/pwm/pwm-loongson.c
> index 412c67739ef9..e31afb11ddd7 100644
> --- a/drivers/pwm/pwm-loongson.c
> +++ b/drivers/pwm/pwm-loongson.c
> @@ -211,7 +211,7 @@ static int pwm_loongson_probe(struct platform_device *pdev)
> if (ddata->clk) {
> ret = devm_clk_rate_exclusive_get(dev, ddata->clk);
> if (ret)
> - return dev_err_probe(dev, PTR_ERR(ddata->clk),
> + return dev_err_probe(dev, ret,
> "Failed to get exclusive rate\n");
>
> ddata->clk_rate = clk_get_rate(ddata->clk);

How embarrassing that I didn't spot that during review. Thanks for the
fix!

Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next
with Binbin's Reviewed-by tag.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature