]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
pinctrl: xway: Delete two error messages for a failed memory allocation in pinmux_xwa...
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 25 Dec 2017 20:51:26 +0000 (21:51 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 3 Jan 2018 07:46:53 +0000 (08:46 +0100)
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>
drivers/pinctrl/pinctrl-xway.c

index f9e98a7d4f0ce088617a4bd4bf90511793809941..cd0f402c116460f8e7edf1d20815f764ce31abab 100644 (file)
@@ -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;