sparc64: Propagate PCI device archdata into OF device tree for EBUS.
In order to convert EBUS drivers doing DMA into pure OF drivers, we need the of_device->dev.archdata setup properly. EBUS instances that can provide DMA for device nodes sit on PCI, so detect and propagate the information there. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
					parent
					
						
							
								e21e245bcd
							
						
					
				
			
			
				commit
				
					
						ae05f87ee2
					
				
			
		
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -337,6 +337,7 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
 | 
				
			||||||
				  struct pci_bus *bus, int devfn)
 | 
									  struct pci_bus *bus, int devfn)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct dev_archdata *sd;
 | 
						struct dev_archdata *sd;
 | 
				
			||||||
 | 
						struct of_device *op;
 | 
				
			||||||
	struct pci_dev *dev;
 | 
						struct pci_dev *dev;
 | 
				
			||||||
	const char *type;
 | 
						const char *type;
 | 
				
			||||||
	u32 class;
 | 
						u32 class;
 | 
				
			||||||
| 
						 | 
					@ -350,14 +351,17 @@ struct pci_dev *of_create_pci_dev(struct pci_pbm_info *pbm,
 | 
				
			||||||
	sd->stc = &pbm->stc;
 | 
						sd->stc = &pbm->stc;
 | 
				
			||||||
	sd->host_controller = pbm;
 | 
						sd->host_controller = pbm;
 | 
				
			||||||
	sd->prom_node = node;
 | 
						sd->prom_node = node;
 | 
				
			||||||
	sd->op = of_find_device_by_node(node);
 | 
						sd->op = op = of_find_device_by_node(node);
 | 
				
			||||||
	sd->numa_node = pbm->numa_node;
 | 
						sd->numa_node = pbm->numa_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	sd = &sd->op->dev.archdata;
 | 
						sd = &op->dev.archdata;
 | 
				
			||||||
	sd->iommu = pbm->iommu;
 | 
						sd->iommu = pbm->iommu;
 | 
				
			||||||
	sd->stc = &pbm->stc;
 | 
						sd->stc = &pbm->stc;
 | 
				
			||||||
	sd->numa_node = pbm->numa_node;
 | 
						sd->numa_node = pbm->numa_node;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!strcmp(node->name, "ebus"))
 | 
				
			||||||
 | 
							of_propagate_archdata(op);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	type = of_get_property(node, "device_type", NULL);
 | 
						type = of_get_property(node, "device_type", NULL);
 | 
				
			||||||
	if (type == NULL)
 | 
						if (type == NULL)
 | 
				
			||||||
		type = "";
 | 
							type = "";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue