pinctrl: imx: Catch no fsl,pins property
authorSascha Hauer <s.hauer@pengutronix.de>
Fri, 9 Aug 2013 12:20:51 +0000 (14:20 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Aug 2013 20:13:11 +0000 (22:13 +0200)
Instead of crashing the kernel print an error message when
the fsl,pins property is missing.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-imx.c

index f1be17f..deeb740 100644 (file)
@@ -456,6 +456,11 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
         * do sanity check and calculate pins number
         */
        list = of_get_property(np, "fsl,pins", &size);
+       if (!list) {
+               dev_err(info->dev, "no fsl,pins property in node %s\n", np->full_name);
+               return -EINVAL;
+       }
+
        /* we do not check return since it's safe node passed down */
        if (!size || size % pin_size) {
                dev_err(info->dev, "Invalid fsl,pins property in node %s\n", np->full_name);