pinctrl: return -ENOMEM instead of -EINVAL for kasprintf() failure
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 25 May 2016 11:14:13 +0000 (20:14 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 31 May 2016 08:33:00 +0000 (10:33 +0200)
-ENOMEM is more suitable error code because kasprintf() fails
in case of memory shortage.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinmux.c

index d94d76ca5651106bda1f024f3a6c7b248fa4c362..ece702881946dd849cae2e7adf2c992697b29fdd 100644 (file)
@@ -256,7 +256,7 @@ int pinmux_request_gpio(struct pinctrl_dev *pctldev,
        /* Conjure some name stating what chip and pin this is taken by */
        owner = kasprintf(GFP_KERNEL, "%s:%d", range->name, gpio);
        if (!owner)
-               return -EINVAL;
+               return -ENOMEM;
 
        ret = pin_request(pctldev, pin, owner, range);
        if (ret < 0)