mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	gpio: mxc: add check to return defer probe if clock tree NOT ready
On i.MX8MQ platform, clock driver uses platform driver
model and it is probed after GPIO driver, so when GPIO
driver fails to get clock, it should check the error type
to decide whether to return defer probe or just ignore
the clock operation.
Fixes: 2808801aab ("gpio: mxc: add clock operation")
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
			
			
This commit is contained in:
		
							parent
							
								
									af39459b89
								
							
						
					
					
						commit
						a329bbe707
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -438,8 +438,11 @@ static int mxc_gpio_probe(struct platform_device *pdev)
 | 
			
		|||
 | 
			
		||||
	/* the controller clock is optional */
 | 
			
		||||
	port->clk = devm_clk_get(&pdev->dev, NULL);
 | 
			
		||||
	if (IS_ERR(port->clk))
 | 
			
		||||
	if (IS_ERR(port->clk)) {
 | 
			
		||||
		if (PTR_ERR(port->clk) == -EPROBE_DEFER)
 | 
			
		||||
			return -EPROBE_DEFER;
 | 
			
		||||
		port->clk = NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	err = clk_prepare_enable(port->clk);
 | 
			
		||||
	if (err) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue