pinctrl: ti: fix error return code of ti_iodelay_dt_node_to_map()
authorJunlin Yang <yangjunlin@yulong.com>
Tue, 30 Mar 2021 06:26:55 +0000 (14:26 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 8 Apr 2021 13:57:14 +0000 (15:57 +0200)
when devm_kcalloc fails, use -ENOMEM instead of -EINVAL,
and consistent with other devm_kcalloc return values.

Signed-off-by: Junlin Yang <yangjunlin@yulong.com>
Link: https://lore.kernel.org/r/20210330062655.1027-1-angkery@163.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/ti/pinctrl-ti-iodelay.c

index e5848269175a7b897149a87548be7c6f2bd524a4..4e2382778d38f557d29fd563b634d7e5e3214046 100644 (file)
@@ -511,8 +511,10 @@ static int ti_iodelay_dt_node_to_map(struct pinctrl_dev *pctldev,
        }
 
        pins = devm_kcalloc(iod->dev, rows, sizeof(*pins), GFP_KERNEL);
-       if (!pins)
+       if (!pins) {
+               error = -ENOMEM;
                goto free_group;
+       }
 
        cfg = devm_kcalloc(iod->dev, rows, sizeof(*cfg), GFP_KERNEL);
        if (!cfg) {