[PATCH 13/20] pinctrl: Error if mapping table's control dev can't be found

From: Stephen Warren
Date: Mon Feb 20 2012 - 01:50:11 EST


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@xxxxxxxxxx>
---
drivers/pinctrl/core.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index ce6016d..5a435f4 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -517,11 +517,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) {
- dev_warn(dev, "unknown pinctrl device %s in map entry",
- 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 -ENODEV;
}

dev_dbg(dev, "in map, found pctldev %s to handle function %s",
--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/