UPSTREAM: pinctrl: rockchip: Delete error messages for a failed memory allocation in two functions

Omit extra messages for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

Change-Id: If4c563f14388b60a9c49bcf4c050198a53c89a6c
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 98c8ee73fe)
This commit is contained in:
Markus Elfring
2017-12-23 22:02:47 +01:00
committed by Tao Huang
parent 84f76e7c4b
commit e9db9f694e

View File

@@ -2724,18 +2724,14 @@ static int rockchip_pinctrl_parse_dt(struct platform_device *pdev,
info->functions = devm_kzalloc(dev, info->nfunctions *
sizeof(struct rockchip_pmx_func),
GFP_KERNEL);
if (!info->functions) {
dev_err(dev, "failed to allocate memory for function list\n");
if (!info->functions)
return -EINVAL;
}
info->groups = devm_kzalloc(dev, info->ngroups *
sizeof(struct rockchip_pin_group),
GFP_KERNEL);
if (!info->groups) {
dev_err(dev, "failed allocate memory for ping group list\n");
if (!info->groups)
return -EINVAL;
}
i = 0;
@@ -2771,10 +2767,9 @@ static int rockchip_pinctrl_register(struct platform_device *pdev,
pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) *
info->ctrl->nr_pins, GFP_KERNEL);
if (!pindesc) {
dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n");
if (!pindesc)
return -ENOMEM;
}
ctrldesc->pins = pindesc;
ctrldesc->npins = info->ctrl->nr_pins;