pinctrl: rockchip: return ENOMEM instead of EINVAL if allocation fails
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Wed, 6 May 2020 10:14:24 +0000 (12:14 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 12 May 2020 13:19:07 +0000 (15:19 +0200)
The function rockchip_pinctrl_parse_dt returns -EINVAL if
allocation fails. Change the return error to -ENOMEM

Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200506101424.15691-1-dafna.hirschfeld@collabora.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-rockchip.c

index 0989513..a9299f0 100644 (file)
@@ -2940,14 +2940,14 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev,
                                              sizeof(struct rockchip_pmx_func),
                                              GFP_KERNEL);
        if (!info->functions)
-               return -EINVAL;
+               return -ENOMEM;
 
        info->groups = devm_kcalloc(dev,
                                            info->ngroups,
                                            sizeof(struct rockchip_pin_group),
                                            GFP_KERNEL);
        if (!info->groups)
-               return -EINVAL;
+               return -ENOMEM;
 
        i = 0;