diff options
Diffstat (limited to 'drivers/pinctrl/pinconf.c')
| -rw-r--r-- | drivers/pinctrl/pinconf.c | 26 | 
1 files changed, 6 insertions, 20 deletions
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index a138965c01c..8bfa0643e5d 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c @@ -28,12 +28,6 @@ int pinconf_check_ops(struct pinctrl_dev *pctldev)  {  	const struct pinconf_ops *ops = pctldev->desc->confops; -	/* We must be able to read out pin status */ -	if (!ops->pin_config_get && !ops->pin_config_group_get) { -		dev_err(pctldev->dev, -			"pinconf must be able to read out pin status\n"); -		return -EINVAL; -	}  	/* We have to be able to config the pins in SOME way */  	if (!ops->pin_config_set && !ops->pin_config_group_set) {  		dev_err(pctldev->dev, @@ -67,9 +61,9 @@ int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,  	const struct pinconf_ops *ops = pctldev->desc->confops;  	if (!ops || !ops->pin_config_get) { -		dev_err(pctldev->dev, "cannot get pin configuration, missing " +		dev_dbg(pctldev->dev, "cannot get pin configuration, missing "  			"pin_config_get() function in driver\n"); -		return -EINVAL; +		return -ENOTSUPP;  	}  	return ops->pin_config_get(pctldev, pin, config); @@ -93,10 +87,10 @@ int pin_config_group_get(const char *dev_name, const char *pin_group,  	ops = pctldev->desc->confops;  	if (!ops || !ops->pin_config_group_get) { -		dev_err(pctldev->dev, "cannot get configuration for pin " +		dev_dbg(pctldev->dev, "cannot get configuration for pin "  			"group, missing group config get function in "  			"driver\n"); -		ret = -EINVAL; +		ret = -ENOTSUPP;  		goto unlock;  	} @@ -302,12 +296,8 @@ static void pinconf_dump_pin(struct pinctrl_dev *pctldev,  static int pinconf_pins_show(struct seq_file *s, void *what)  {  	struct pinctrl_dev *pctldev = s->private; -	const struct pinconf_ops *ops = pctldev->desc->confops;  	unsigned i, pin; -	if (!ops || !ops->pin_config_get) -		return 0; -  	seq_puts(s, "Pin config settings per pin\n");  	seq_puts(s, "Format: pin (name): configs\n"); @@ -352,13 +342,9 @@ static int pinconf_groups_show(struct seq_file *s, void *what)  {  	struct pinctrl_dev *pctldev = s->private;  	const struct pinctrl_ops *pctlops = pctldev->desc->pctlops; -	const struct pinconf_ops *ops = pctldev->desc->confops;  	unsigned ngroups = pctlops->get_groups_count(pctldev);  	unsigned selector = 0; -	if (!ops || !ops->pin_config_group_get) -		return 0; -  	seq_puts(s, "Pin config settings per pin group\n");  	seq_puts(s, "Format: group (name): configs\n"); @@ -490,7 +476,7 @@ exit:   * <devicename> <state> <pinname> are values that should match the pinctrl-maps   * <newvalue> reflects the new config and is driver dependant   */ -static int pinconf_dbg_config_write(struct file *file, +static ssize_t pinconf_dbg_config_write(struct file *file,  	const char __user *user_buf, size_t count, loff_t *ppos)  {  	struct pinctrl_maps *maps_node; @@ -508,7 +494,7 @@ static int pinconf_dbg_config_write(struct file *file,  	int i;  	/* Get userspace string and assure termination */ -	buf_size = min(count, (size_t)(sizeof(buf)-1)); +	buf_size = min(count, sizeof(buf) - 1);  	if (copy_from_user(buf, user_buf, buf_size))  		return -EFAULT;  	buf[buf_size] = 0;  | 
