From f026fe3d102e9d7f0d040109353ef5a97b5ef92c Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Sun, 19 Feb 2012 23:45:51 -0700 Subject: pinctrl: downgrade pinctrl_get warning when no maps are found This may be perfectly legitimate. An IP block may get re-used across SoCs. Not all of those SoCs may need pinmux settings for the IP block, e.g. if one SoC dedicates pins to that function but another doesn't. The driver won't know this, and will always attempt to set up the pinmux. The mapping table defines whether any HW programming is actually needed. Acked-by: Shawn Guo Signed-off-by: Stephen Warren [rebased to fit the applied patch series] Signed-off-by: Linus Walleij --- drivers/pinctrl/core.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'drivers/pinctrl/core.c') diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 552d8c1..e2d4abb 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -567,14 +567,16 @@ static struct pinctrl *pinctrl_get_locked(struct device *dev, const char *name) } } - /* We should have atleast one map, right */ - if (!num_maps) { - pr_err("could not find any mux maps for device %s, ID %s\n", - devname ? devname : "(anonymous)", - name ? name : "(undefined)"); - kfree(p); - return ERR_PTR(-EINVAL); - } + /* + * This may be perfectly legitimate. An IP block may get re-used + * across SoCs. Not all of those SoCs may need pinmux settings for the + * IP block, e.g. if one SoC dedicates pins to that function but + * another doesn't. The driver won't know this, and will always + * attempt to set up the pinmux. The mapping table defines whether any + * HW programming is actually needed. + */ + if (!num_maps) + dev_info(dev, "zero maps found for mapping %s\n", name); pr_debug("found %u mux maps for device %s, UD %s\n", num_maps, -- cgit v1.1