mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	mfd: vexpress-sysreg: Don't skip initialization on probe
The vexpress-sysreg driver does not have to be initialized early, when the platform doesn't require this. Unfortunately in such case it wasn't initialized correctly - master site lookup and config bridge registration were missing. Fixed now. Signed-off-by: Pawel Moll <pawel.moll@arm.com>
This commit is contained in:
		
							parent
							
								
									ab838bc9c2
								
							
						
					
					
						commit
						52666298ae
					
				
					 1 changed files with 20 additions and 12 deletions
				
			
		| 
						 | 
					@ -313,19 +313,11 @@ static void vexpress_sysreg_config_complete(unsigned long data)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init vexpress_sysreg_early_init(void __iomem *base)
 | 
					void __init vexpress_sysreg_setup(struct device_node *node)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct device_node *node = of_find_compatible_node(NULL, NULL,
 | 
						if (WARN_ON(!vexpress_sysreg_base))
 | 
				
			||||||
			"arm,vexpress-sysreg");
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (node)
 | 
					 | 
				
			||||||
		base = of_iomap(node, 0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (WARN_ON(!base))
 | 
					 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	vexpress_sysreg_base = base;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE)
 | 
						if (readl(vexpress_sysreg_base + SYS_MISC) & SYS_MISC_MASTERSITE)
 | 
				
			||||||
		vexpress_master_site = VEXPRESS_SITE_DB2;
 | 
							vexpress_master_site = VEXPRESS_SITE_DB2;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
| 
						 | 
					@ -336,9 +328,23 @@ void __init vexpress_sysreg_early_init(void __iomem *base)
 | 
				
			||||||
	WARN_ON(!vexpress_sysreg_config_bridge);
 | 
						WARN_ON(!vexpress_sysreg_config_bridge);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void __init vexpress_sysreg_early_init(void __iomem *base)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						vexpress_sysreg_base = base;
 | 
				
			||||||
 | 
						vexpress_sysreg_setup(NULL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void __init vexpress_sysreg_of_early_init(void)
 | 
					void __init vexpress_sysreg_of_early_init(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	vexpress_sysreg_early_init(NULL);
 | 
						struct device_node *node = of_find_compatible_node(NULL, NULL,
 | 
				
			||||||
 | 
								"arm,vexpress-sysreg");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (node) {
 | 
				
			||||||
 | 
							vexpress_sysreg_base = of_iomap(node, 0);
 | 
				
			||||||
 | 
							vexpress_sysreg_setup(node);
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							pr_info("vexpress-sysreg: No Device Tree node found.");
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -426,9 +432,11 @@ static int vexpress_sysreg_probe(struct platform_device *pdev)
 | 
				
			||||||
		return -EBUSY;
 | 
							return -EBUSY;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!vexpress_sysreg_base)
 | 
						if (!vexpress_sysreg_base) {
 | 
				
			||||||
		vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start,
 | 
							vexpress_sysreg_base = devm_ioremap(&pdev->dev, res->start,
 | 
				
			||||||
				resource_size(res));
 | 
									resource_size(res));
 | 
				
			||||||
 | 
							vexpress_sysreg_setup(pdev->dev.of_node);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!vexpress_sysreg_base) {
 | 
						if (!vexpress_sysreg_base) {
 | 
				
			||||||
		dev_err(&pdev->dev, "Failed to obtain base address!\n");
 | 
							dev_err(&pdev->dev, "Failed to obtain base address!\n");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue