summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/pinconf.c')
-rw-r--r--drivers/pinctrl/pinconf.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 84869f28b10..b40ac1b4fb1 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -282,21 +282,28 @@ int pinconf_map_to_setting(struct pinctrl_map const *map,
struct pinctrl_setting *setting)
{
struct pinctrl_dev *pctldev = setting->pctldev;
+ int pin;
switch (setting->type) {
case PIN_MAP_TYPE_CONFIGS_PIN:
- setting->data.configs.group_or_pin =
- pin_get_from_name(pctldev,
- map->data.configs.group_or_pin);
- if (setting->data.configs.group_or_pin < 0)
- return setting->data.configs.group_or_pin;
+ pin = pin_get_from_name(pctldev,
+ map->data.configs.group_or_pin);
+ if (pin < 0) {
+ dev_err(pctldev->dev, "could not map pin config for \"%s\"",
+ map->data.configs.group_or_pin);
+ return pin;
+ }
+ setting->data.configs.group_or_pin = pin;
break;
case PIN_MAP_TYPE_CONFIGS_GROUP:
- setting->data.configs.group_or_pin =
- pinctrl_get_group_selector(pctldev,
- map->data.configs.group_or_pin);
- if (setting->data.configs.group_or_pin < 0)
- return setting->data.configs.group_or_pin;
+ pin = pinctrl_get_group_selector(pctldev,
+ map->data.configs.group_or_pin);
+ if (pin < 0) {
+ dev_err(pctldev->dev, "could not map group config for \"%s\"",
+ map->data.configs.group_or_pin);
+ return pin;
+ }
+ setting->data.configs.group_or_pin = pin;
break;
default:
return -EINVAL;