mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	gpio: mb86s70: Return error if requesting an already assigned gpio
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
		
							parent
							
								
									c517d838eb
								
							
						
					
					
						commit
						fd9c963c56
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -58,6 +58,11 @@ static int mb86s70_gpio_request(struct gpio_chip *gc, unsigned gpio)
 | 
			
		|||
	spin_lock_irqsave(&gchip->lock, flags);
 | 
			
		||||
 | 
			
		||||
	val = readl(gchip->base + PFR(gpio));
 | 
			
		||||
	if (!(val & OFFSET(gpio))) {
 | 
			
		||||
		spin_unlock_irqrestore(&gchip->lock, flags);
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	val &= ~OFFSET(gpio);
 | 
			
		||||
	writel(val, gchip->base + PFR(gpio));
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue