mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-10-31 08:44:41 +00:00 
			
		
		
		
	gpio-ich: Fix value returned by ichx_gpio_request
Per Documentation/gpio.txt, gpio_request callbacks should return 0 on success or a negative value on error. So it is not clear what was meant by letting ichx_gpio_request return 1 in some cases, nor how a caller would interpret it. Align the code with the comment above it and consider pins as available by default. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
		
							parent
							
								
									a937536b86
								
							
						
					
					
						commit
						2ab3a749eb
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -214,7 +214,7 @@ static int ichx_gpio_request(struct gpio_chip *chip, unsigned nr) | ||||||
| 	 * If it can't be trusted, assume that the pin can be used as a GPIO. | 	 * If it can't be trusted, assume that the pin can be used as a GPIO. | ||||||
| 	 */ | 	 */ | ||||||
| 	if (ichx_priv.desc->use_sel_ignore[nr / 32] & (1 << (nr & 0x1f))) | 	if (ichx_priv.desc->use_sel_ignore[nr / 32] & (1 << (nr & 0x1f))) | ||||||
| 		return 1; | 		return 0; | ||||||
| 
 | 
 | ||||||
| 	return ichx_read_bit(GPIO_USE_SEL, nr) ? 0 : -ENODEV; | 	return ichx_read_bit(GPIO_USE_SEL, nr) ? 0 : -ENODEV; | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Jean Delvare
						Jean Delvare