Commit 77d3d2e2 authored by Markus Elfring's avatar Markus Elfring Committed by Linus Walleij

pinctrl: mvebu: Delete an error message for a failed memory allocation in three functions

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus fix the affected source code places.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e6e965ce
...@@ -399,12 +399,8 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, ...@@ -399,12 +399,8 @@ static int mvebu_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
} }
*map = kmalloc_array(nmaps, sizeof(**map), GFP_KERNEL); *map = kmalloc_array(nmaps, sizeof(**map), GFP_KERNEL);
if (*map == NULL) { if (!*map)
dev_err(pctl->dev,
"cannot allocate pinctrl_map memory for %s\n",
np->name);
return -ENOMEM; return -ENOMEM;
}
n = 0; n = 0;
of_property_for_each_string(np, "marvell,pins", prop, group) { of_property_for_each_string(np, "marvell,pins", prop, group) {
...@@ -563,10 +559,8 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) ...@@ -563,10 +559,8 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
pctl = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pinctrl), pctl = devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pinctrl),
GFP_KERNEL); GFP_KERNEL);
if (!pctl) { if (!pctl)
dev_err(&pdev->dev, "unable to alloc driver\n");
return -ENOMEM; return -ENOMEM;
}
pctl->desc.name = dev_name(&pdev->dev); pctl->desc.name = dev_name(&pdev->dev);
pctl->desc.owner = THIS_MODULE; pctl->desc.owner = THIS_MODULE;
...@@ -604,10 +598,8 @@ int mvebu_pinctrl_probe(struct platform_device *pdev) ...@@ -604,10 +598,8 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
pdesc = devm_kzalloc(&pdev->dev, pctl->desc.npins * pdesc = devm_kzalloc(&pdev->dev, pctl->desc.npins *
sizeof(struct pinctrl_pin_desc), GFP_KERNEL); sizeof(struct pinctrl_pin_desc), GFP_KERNEL);
if (!pdesc) { if (!pdesc)
dev_err(&pdev->dev, "failed to alloc pinctrl pins\n");
return -ENOMEM; return -ENOMEM;
}
for (n = 0; n < pctl->desc.npins; n++) for (n = 0; n < pctl->desc.npins; n++)
pdesc[n].number = n; pdesc[n].number = n;
......
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