mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-10-31 20:18:18 +00:00 
			
		
		
		
	We have a 'safe' version of this function but sometimes it is not needed. Add a normal version too and update a few places that can use it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
		
			
				
	
	
		
			32 lines
		
	
	
		
			600 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			600 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0+
 | |
| /*
 | |
|  * Copyright (C) 2016 Socionext Inc.
 | |
|  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 | |
|  */
 | |
| 
 | |
| #include <common.h>
 | |
| #include <linux/errno.h>
 | |
| #include <dm.h>
 | |
| #include <dm/pinctrl.h>
 | |
| 
 | |
| #include "init.h"
 | |
| 
 | |
| int uniphier_pin_init(const char *pinconfig_name)
 | |
| {
 | |
| 	struct udevice *pctldev, *config;
 | |
| 	int ret;
 | |
| 
 | |
| 	ret = uclass_first_device(UCLASS_PINCTRL, &pctldev);
 | |
| 	if (ret)
 | |
| 		return ret;
 | |
| 
 | |
| 	device_foreach_child(config, pctldev) {
 | |
| 		if (strcmp(config->name, pinconfig_name))
 | |
| 			continue;
 | |
| 
 | |
| 		return pinctrl_generic_set_state(pctldev, config);
 | |
| 	}
 | |
| 
 | |
| 	return -ENODEV;
 | |
| }
 |