pinctrl: single: Delete an error message for a failed memory allocation in pcs_probe()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 25 Dec 2017 10:27:55 +0000 (11:27 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 3 Jan 2018 07:46:51 +0000 (08:46 +0100)
Omit an extra message 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-single.c

index 6f95e6a..2b93d8a 100644 (file)
@@ -1646,10 +1646,9 @@ static int pcs_probe(struct platform_device *pdev)
                return -EINVAL;
 
        pcs = devm_kzalloc(&pdev->dev, sizeof(*pcs), GFP_KERNEL);
-       if (!pcs) {
-               dev_err(&pdev->dev, "could not allocate\n");
+       if (!pcs)
                return -ENOMEM;
-       }
+
        pcs->dev = &pdev->dev;
        pcs->np = np;
        raw_spin_lock_init(&pcs->lock);