public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling
@ 2025-10-14  6:13 Alexander Stein
  2025-10-14 17:18 ` Lizhi Hou
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alexander Stein @ 2025-10-14  6:13 UTC (permalink / raw)
  To: Lizhi Hou, Brian Xu, Raj Kumar Rampelli, Vinod Koul, Michal Simek,
	Max Zhen, Sonal Santan
  Cc: Alexander Stein, dmaengine, linux-arm-kernel, linux-kernel

devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL.
Fix the error check and also fix the error message. Use the error code
from ERR_PTR() instead of the wrong value in ret.

Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/dma/xilinx/xdma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index 3d9e92bbc9bb0..c5fe69b98f61d 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -1325,8 +1325,8 @@ static int xdma_probe(struct platform_device *pdev)
 
 	xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
 					   &xdma_regmap_config);
-	if (!xdev->rmap) {
-		xdma_err(xdev, "config regmap failed: %d", ret);
+	if (IS_ERR(xdev->rmap)) {
+		xdma_err(xdev, "config regmap failed: %pe", xdev->rmap);
 		goto failed;
 	}
 	INIT_LIST_HEAD(&xdev->dma_dev.channels);
-- 
2.43.0



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

* Re: [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling
  2025-10-14  6:13 [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling Alexander Stein
@ 2025-10-14 17:18 ` Lizhi Hou
  2026-03-04 14:14 ` Alexander Stein
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Lizhi Hou @ 2025-10-14 17:18 UTC (permalink / raw)
  To: Alexander Stein, Brian Xu, Raj Kumar Rampelli, Vinod Koul,
	Michal Simek, Max Zhen, Sonal Santan
  Cc: dmaengine, linux-arm-kernel, linux-kernel

Hi Vinod,


This has been reported by multiple users. e.g.

https://lore.kernel.org/dmaengine/CALYqZ9=pVRtSY=w4hG0R3HEM_Y=bpLba2_jRcvcZX4eLX5Yw-A@mail.gmail.com/

https://lore.kernel.org/dmaengine/20240819193641.600176-1-harshit.m.mogalapalli@oracle.com/

Could you help to merge this fix?


Thanks,

Lizhi

On 10/13/25 23:13, Alexander Stein wrote:
> devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL.
> Fix the error check and also fix the error message. Use the error code
> from ERR_PTR() instead of the wrong value in ret.
>
> Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---
>   drivers/dma/xilinx/xdma.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
> index 3d9e92bbc9bb0..c5fe69b98f61d 100644
> --- a/drivers/dma/xilinx/xdma.c
> +++ b/drivers/dma/xilinx/xdma.c
> @@ -1325,8 +1325,8 @@ static int xdma_probe(struct platform_device *pdev)
>   
>   	xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
>   					   &xdma_regmap_config);
> -	if (!xdev->rmap) {
> -		xdma_err(xdev, "config regmap failed: %d", ret);
> +	if (IS_ERR(xdev->rmap)) {
> +		xdma_err(xdev, "config regmap failed: %pe", xdev->rmap);
>   		goto failed;
>   	}
>   	INIT_LIST_HEAD(&xdev->dma_dev.channels);


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

* Re: [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling
  2025-10-14  6:13 [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling Alexander Stein
  2025-10-14 17:18 ` Lizhi Hou
@ 2026-03-04 14:14 ` Alexander Stein
  2026-03-04 15:33 ` Frank Li
  2026-03-09  7:43 ` Vinod Koul
  3 siblings, 0 replies; 5+ messages in thread
From: Alexander Stein @ 2026-03-04 14:14 UTC (permalink / raw)
  To: Lizhi Hou, Brian Xu, Raj Kumar Rampelli, Vinod Koul, Michal Simek,
	Max Zhen, Sonal Santan
  Cc: dmaengine, linux-arm-kernel, linux-kernel

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

Am Dienstag, 14. Oktober 2025, 08:13:08 CET schrieb Alexander Stein:
> devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL.
> Fix the error check and also fix the error message. Use the error code
> from ERR_PTR() instead of the wrong value in ret.
> 
> Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Ping,
any feedback?

Thanks
Alexander

> ---
>  drivers/dma/xilinx/xdma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
> index 3d9e92bbc9bb0..c5fe69b98f61d 100644
> --- a/drivers/dma/xilinx/xdma.c
> +++ b/drivers/dma/xilinx/xdma.c
> @@ -1325,8 +1325,8 @@ static int xdma_probe(struct platform_device *pdev)
>  
>  	xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
>  					   &xdma_regmap_config);
> -	if (!xdev->rmap) {
> -		xdma_err(xdev, "config regmap failed: %d", ret);
> +	if (IS_ERR(xdev->rmap)) {
> +		xdma_err(xdev, "config regmap failed: %pe", xdev->rmap);
>  		goto failed;
>  	}
>  	INIT_LIST_HEAD(&xdev->dma_dev.channels);
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling
  2025-10-14  6:13 [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling Alexander Stein
  2025-10-14 17:18 ` Lizhi Hou
  2026-03-04 14:14 ` Alexander Stein
@ 2026-03-04 15:33 ` Frank Li
  2026-03-09  7:43 ` Vinod Koul
  3 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-03-04 15:33 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Lizhi Hou, Brian Xu, Raj Kumar Rampelli, Vinod Koul, Michal Simek,
	Max Zhen, Sonal Santan, dmaengine, linux-arm-kernel, linux-kernel

On Tue, Oct 14, 2025 at 08:13:08AM +0200, Alexander Stein wrote:
> devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL.
> Fix the error check and also fix the error message. Use the error code
> from ERR_PTR() instead of the wrong value in ret.
>
> Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/dma/xilinx/xdma.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
> index 3d9e92bbc9bb0..c5fe69b98f61d 100644
> --- a/drivers/dma/xilinx/xdma.c
> +++ b/drivers/dma/xilinx/xdma.c
> @@ -1325,8 +1325,8 @@ static int xdma_probe(struct platform_device *pdev)
>
>  	xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
>  					   &xdma_regmap_config);
> -	if (!xdev->rmap) {
> -		xdma_err(xdev, "config regmap failed: %d", ret);
> +	if (IS_ERR(xdev->rmap)) {
> +		xdma_err(xdev, "config regmap failed: %pe", xdev->rmap);
>  		goto failed;
>  	}
>  	INIT_LIST_HEAD(&xdev->dma_dev.channels);
> --
> 2.43.0
>


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

* Re: [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling
  2025-10-14  6:13 [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling Alexander Stein
                   ` (2 preceding siblings ...)
  2026-03-04 15:33 ` Frank Li
@ 2026-03-09  7:43 ` Vinod Koul
  3 siblings, 0 replies; 5+ messages in thread
From: Vinod Koul @ 2026-03-09  7:43 UTC (permalink / raw)
  To: Lizhi Hou, Brian Xu, Raj Kumar Rampelli, Michal Simek, Max Zhen,
	Sonal Santan, Alexander Stein
  Cc: dmaengine, linux-arm-kernel, linux-kernel


On Tue, 14 Oct 2025 08:13:08 +0200, Alexander Stein wrote:
> devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL.
> Fix the error check and also fix the error message. Use the error code
> from ERR_PTR() instead of the wrong value in ret.
> 
> 

Applied, thanks!

[1/1] dmaengine: xilinx: xdma: Fix regmap init error handling
      commit: e0adbf74e2a0455a6bc9628726ba87bcd0b42bf8

Best regards,
-- 
~Vinod




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

end of thread, other threads:[~2026-03-09  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-14  6:13 [PATCH 1/1] dmaengine: xilinx: xdma: Fix regmap init error handling Alexander Stein
2025-10-14 17:18 ` Lizhi Hou
2026-03-04 14:14 ` Alexander Stein
2026-03-04 15:33 ` Frank Li
2026-03-09  7:43 ` Vinod Koul

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