power/reset: xgene: Return -ENOMEM if out of memory
authorGuenter Roeck <linux@roeck-us.net>
Tue, 30 Sep 2014 17:48:28 +0000 (10:48 -0700)
committerSebastian Reichel <sre@kernel.org>
Mon, 17 Nov 2014 02:07:09 +0000 (03:07 +0100)
It is customary to return an error code of -ENOMEM if the system
is out of memory. Also, in that case, the infrastructure will report
an error, so it is unnecessary to report it again.

Cc: Loc Ho <lho@apm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/power/reset/xgene-reboot.c

index 6b49be6..6ca4bf9 100644 (file)
@@ -61,10 +61,8 @@ static int xgene_reboot_probe(struct platform_device *pdev)
        struct xgene_reboot_context *ctx;
 
        ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
-       if (!ctx) {
-               dev_err(&pdev->dev, "out of memory for context\n");
-               return -ENODEV;
-       }
+       if (!ctx)
+               return -ENOMEM;
 
        ctx->csr = of_iomap(pdev->dev.of_node, 0);
        if (!ctx->csr) {