From: Joey Gouly Date: Sun, 21 Nov 2021 16:56:42 +0000 (+0000) Subject: pinctrl: apple: return an error if pinmux is missing in the DT X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=839930ca1bd0c79cdf370d11462ef4a81b664e44;p=linux.git 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: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs") Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-12-joey.gouly@arm.com Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c index 8a58c862c33a1..89602aa14c6a5 100644 --- a/drivers/pinctrl/pinctrl-apple-gpio.c +++ b/drivers/pinctrl/pinctrl-apple-gpio.c @@ -119,7 +119,7 @@ static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev, dev_err(pctl->dev, "missing or empty pinmux property in node %pOFn.\n", node); - return ret; + return ret ? ret : -EINVAL; } num_pins = ret;