forked from mirrors/linux
		
	spi: atmel-quadspi: Simpify resource lookup
Use the devm_platform_ioremap_resource_byname() helper instead of calling platform_get_resource_byname() and devm_ioremap_resource() separately. Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Link: https://patch.msgid.link/20240820123818.1788432-1-ruanjinjie@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
		
							parent
							
								
									3bf2a5359b
								
							
						
					
					
						commit
						3ccea1dede
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -601,16 +601,14 @@ static int atmel_qspi_probe(struct platform_device *pdev)
 | 
			
		|||
	aq->pdev = pdev;
 | 
			
		||||
 | 
			
		||||
	/* Map the registers */
 | 
			
		||||
	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_base");
 | 
			
		||||
	aq->regs = devm_ioremap_resource(&pdev->dev, res);
 | 
			
		||||
	aq->regs = devm_platform_ioremap_resource_byname(pdev, "qspi_base");
 | 
			
		||||
	if (IS_ERR(aq->regs)) {
 | 
			
		||||
		dev_err(&pdev->dev, "missing registers\n");
 | 
			
		||||
		return PTR_ERR(aq->regs);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Map the AHB memory */
 | 
			
		||||
	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "qspi_mmap");
 | 
			
		||||
	aq->mem = devm_ioremap_resource(&pdev->dev, res);
 | 
			
		||||
	aq->mem = devm_platform_ioremap_resource_byname(pdev, "qspi_mmap");
 | 
			
		||||
	if (IS_ERR(aq->mem)) {
 | 
			
		||||
		dev_err(&pdev->dev, "missing AHB memory\n");
 | 
			
		||||
		return PTR_ERR(aq->mem);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue