mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	PCI: mvebu: Only remap I/O space if configured
If there is no PCI I/O aperture configured in the Device Tree, it does not make sense to create the virtual mapping for the PCI I/O space, since we will anyway not create the MBus window that will allow to access it. Therefore, do the pci_ioremap_io() only if necessary. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
This commit is contained in:
		
							parent
							
								
									dfd0309fd7
								
							
						
					
					
						commit
						ee1604381a
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -1220,6 +1220,9 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
 | 
				
			||||||
		pcie->realio.end = min_t(resource_size_t,
 | 
							pcie->realio.end = min_t(resource_size_t,
 | 
				
			||||||
					 IO_SPACE_LIMIT,
 | 
										 IO_SPACE_LIMIT,
 | 
				
			||||||
					 resource_size(&pcie->io) - 1);
 | 
										 resource_size(&pcie->io) - 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K)
 | 
				
			||||||
 | 
								pci_ioremap_io(i, pcie->io.start + i);
 | 
				
			||||||
	} else
 | 
						} else
 | 
				
			||||||
		pcie->realio = pcie->io;
 | 
							pcie->realio = pcie->io;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1278,9 +1281,6 @@ static int mvebu_pcie_probe(struct platform_device *pdev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pcie->nports = i;
 | 
						pcie->nports = i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < (IO_SPACE_LIMIT - SZ_64K); i += SZ_64K)
 | 
					 | 
				
			||||||
		pci_ioremap_io(i, pcie->io.start + i);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	mvebu_pcie_enable(pcie);
 | 
						mvebu_pcie_enable(pcie);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue