Commit c4f333b7 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Linus Walleij

pinctrl: rockchip: return ENOMEM instead of EINVAL if allocation fails

The function rockchip_pinctrl_parse_dt returns -EINVAL if
allocation fails. Change the return error to -ENOMEM
Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20200506101424.15691-1-dafna.hirschfeld@collabora.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent c7acd6fe
...@@ -2940,14 +2940,14 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev, ...@@ -2940,14 +2940,14 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev,
sizeof(struct rockchip_pmx_func), sizeof(struct rockchip_pmx_func),
GFP_KERNEL); GFP_KERNEL);
if (!info->functions) if (!info->functions)
return -EINVAL; return -ENOMEM;
info->groups = devm_kcalloc(dev, info->groups = devm_kcalloc(dev,
info->ngroups, info->ngroups,
sizeof(struct rockchip_pin_group), sizeof(struct rockchip_pin_group),
GFP_KERNEL); GFP_KERNEL);
if (!info->groups) if (!info->groups)
return -EINVAL; return -ENOMEM;
i = 0; i = 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