Commit 1fb1f054 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Linus Walleij

pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure

-ENOMEM is more suitable error code because kasprintf() fails
in case of memory shortage.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 8b2b3dcb
...@@ -256,7 +256,7 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev, ...@@ -256,7 +256,7 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev,
/* Conjure some name stating what chip and pin this is taken by */ /* Conjure some name stating what chip and pin this is taken by */
owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio); owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio);
if (!owner) if (!owner)
return -EINVAL; return -ENOMEM;
ret = pin_request(pctldev, pin, owner, range); ret = pin_request(pctldev, pin, owner, range);
if (ret < 0) if (ret < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment