提交 839930ca 编写于 作者: J Joey Gouly 提交者: Linus Walleij

pinctrl: apple: return an error if pinmux is missing in the DT

If of_property_count_u32_elems returned 0, return -EINVAL to indicate
a failure. Previously this would return 0.

Fixes: a0f160ff ("pinctrl: add pinctrl/GPIO driver for Apple SoCs")
Signed-off-by: NJoey Gouly <joey.gouly@arm.com>
Suggested-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20211121165642.27883-12-joey.gouly@arm.comSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 077db34c
...@@ -119,7 +119,7 @@ static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -119,7 +119,7 @@ static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev,
dev_err(pctl->dev, dev_err(pctl->dev,
"missing or empty pinmux property in node %pOFn.\n", "missing or empty pinmux property in node %pOFn.\n",
node); node);
return ret; return ret ? ret : -EINVAL;
} }
num_pins = ret; num_pins = ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册