diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-12-25 23:51:26 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-01-03 10:46:53 +0300 |
commit | e423f0ceef436b3246fd8b0d5ed51cf89fd8b45e (patch) | |
tree | d30e32f2512b64955168eccd8f088200456392b2 | |
parent | 86f75c65ffc028df28e6b5a6f6574a5beea97310 (diff) | |
download | linux-e423f0ceef436b3246fd8b0d5ed51cf89fd8b45e.tar.xz |
pinctrl: xway: Delete two error messages for a failed memory allocation in pinmux_xway_probe()
Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/pinctrl/pinctrl-xway.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c index f9e98a7d4f0c..cd0f402c1164 100644 --- a/drivers/pinctrl/pinctrl-xway.c +++ b/drivers/pinctrl/pinctrl-xway.c @@ -1730,18 +1730,16 @@ static int pinmux_xway_probe(struct platform_device *pdev) xway_info.pads = devm_kzalloc(&pdev->dev, sizeof(struct pinctrl_pin_desc) * xway_chip.ngpio, GFP_KERNEL); - if (!xway_info.pads) { - dev_err(&pdev->dev, "Failed to allocate pads\n"); + if (!xway_info.pads) return -ENOMEM; - } + for (i = 0; i < xway_chip.ngpio; i++) { /* strlen("ioXY") + 1 = 5 */ char *name = devm_kzalloc(&pdev->dev, 5, GFP_KERNEL); - if (!name) { - dev_err(&pdev->dev, "Failed to allocate pad name\n"); + if (!name) return -ENOMEM; - } + snprintf(name, 5, "io%d", i); xway_info.pads[i].number = GPIO0 + i; xway_info.pads[i].name = name; |