Skip to content

Commit

Permalink
pinctrl: error if mapping table's control dev can't be found
Browse files Browse the repository at this point in the history
This is a serious error, and the pin control system will not function
correctly if it ends up not programing the mapping table entries into
the HW. Instead of just ignoring this, error out.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
[rebased to fit the applied patch series, cast error to pointer]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Stephen Warren authored and Linus Walleij committed Feb 22, 2012
1 parent f026fe3 commit b1eed4e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions drivers/pinctrl/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,12 @@ static struct pinctrl *pinctrl_get_locked(struct device *dev, const char *name)
*/
pctldev = get_pinctrl_dev_from_devname(map->ctrl_dev_name);
if (!pctldev) {
pr_warning("could not find a pinctrl device for pinmux function %s, fishy, they shall all have one\n",
map->function);
pr_warning("given pinctrl device name: %s",
map->ctrl_dev_name);

/* Continue to check the other mappings anyway... */
continue;
dev_err(dev, "unknown pinctrl device %s in map entry",
map->ctrl_dev_name);
pinmux_put(p);
kfree(p);
/* Eventually, this should trigger deferred probe */
return ERR_PTR(-ENODEV);
}

pr_debug("in map, found pctldev %s to handle function %s",
Expand Down

0 comments on commit b1eed4e

Please sign in to comment.