mirror of
				https://git.openwrt.org/openwrt/openwrt.git
				synced 2025-10-31 20:18:35 +00:00 
			
		
		
		
	Backport additional patch required for NPU support of Airoha AN7583. These are specific for the NPU module with some minor fixes and to adds upport for loading the specific Airoha AN7583 NPU firmware. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 1e5e40f2558c07f6bc60a8983000309cc0a9d600 Mon Sep 17 00:00:00 2001
 | |
| From: Dan Carpenter <dan.carpenter@linaro.org>
 | |
| Date: Tue, 15 Jul 2025 18:01:10 -0500
 | |
| Subject: [PATCH] net: airoha: Fix a NULL vs IS_ERR() bug in
 | |
|  airoha_npu_run_firmware()
 | |
| 
 | |
| The devm_ioremap_resource() function returns error pointers.  It never
 | |
| returns NULL.  Update the check to match.
 | |
| 
 | |
| Fixes: e27dba1951ce ("net: Use of_reserved_mem_region_to_resource{_byname}() for "memory-region"")
 | |
| Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
 | |
| Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
 | |
| Link: https://patch.msgid.link/fc6d194e-6bf5-49ca-bc77-3fdfda62c434@sabinyo.mountain
 | |
| Signed-off-by: Jakub Kicinski <kuba@kernel.org>
 | |
| ---
 | |
|  drivers/net/ethernet/airoha/airoha_npu.c | 4 ++--
 | |
|  1 file changed, 2 insertions(+), 2 deletions(-)
 | |
| 
 | |
| --- a/drivers/net/ethernet/airoha/airoha_npu.c
 | |
| +++ b/drivers/net/ethernet/airoha/airoha_npu.c
 | |
| @@ -201,8 +201,8 @@ static int airoha_npu_run_firmware(struc
 | |
|  	}
 | |
|  
 | |
|  	addr = devm_ioremap(dev, rmem->base, rmem->size);
 | |
| -	if (!addr) {
 | |
| -		ret = -ENOMEM;
 | |
| +	if (IS_ERR(addr)) {
 | |
| +		ret = PTR_ERR(addr);
 | |
|  		goto out;
 | |
|  	}
 | |
|  
 |