gpio: of: Fix NPE from OF flags

Some calls to of_get_named_gpio() calls sets the flags
argument to NULL because they are not interested in the
flags. This caused a null pointer exception since we were
unconditionally using these flags. Fix it.

Fixes: 6a537d4846 ("gpio: of: Support regulator nonstandard GPIO properties")
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Linus Walleij 2018-01-16 23:44:46 +01:00
parent 0f7192318b
commit 605f2d34ea

View File

@ -129,6 +129,7 @@ struct gpio_desc *of_get_named_gpiod_flags(struct device_node *np,
if (IS_ERR(desc))
goto out;
if (flags)
of_gpio_flags_quirks(np, flags);
pr_debug("%s: parsed '%s' property of node '%pOF[%d]' - status (%d)\n",