The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH next] pwm: loongson: Fix an error code in probe()
@ 2025-04-09 11:00 Dan Carpenter
  2025-04-15 12:16 ` Binbin Zhou
  2025-04-16  5:24 ` Uwe Kleine-König
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-04-09 11:00 UTC (permalink / raw)
  To: Binbin Zhou
  Cc: Uwe Kleine-König, Huacai Chen, Juxin Gao, linux-pwm,
	linux-kernel, kernel-janitors

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@linaro.org>
---
 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);
-- 
2.47.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH next] pwm: loongson: Fix an error code in probe()
  2025-04-09 11:00 [PATCH next] pwm: loongson: Fix an error code in probe() Dan Carpenter
@ 2025-04-15 12:16 ` Binbin Zhou
  2025-04-16  5:24 ` Uwe Kleine-König
  1 sibling, 0 replies; 3+ messages in thread
From: Binbin Zhou @ 2025-04-15 12:16 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Uwe Kleine-König, Huacai Chen, Juxin Gao, linux-pwm,
	linux-kernel, kernel-janitors

Hi Dan:

Sorry for my late reply and thanks for fixing my cheap mistake.

On 2025/4/9 19:00, 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@linaro.org>
Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>   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);
Thanks.
Binbin


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH next] pwm: loongson: Fix an error code in probe()
  2025-04-09 11:00 [PATCH next] pwm: loongson: Fix an error code in probe() Dan Carpenter
  2025-04-15 12:16 ` Binbin Zhou
@ 2025-04-16  5:24 ` Uwe Kleine-König
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2025-04-16  5:24 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Binbin Zhou, Huacai Chen, Juxin Gao, linux-pwm, linux-kernel,
	kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

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@linaro.org>
> ---
>  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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-16  5:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 11:00 [PATCH next] pwm: loongson: Fix an error code in probe() Dan Carpenter
2025-04-15 12:16 ` Binbin Zhou
2025-04-16  5:24 ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox