power/reset: xgene: Return -ENOMEM if out of memory
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>
This commit is contained in:
parent
46c99ac662
commit
ef288f9f65
drivers/power/reset
|
@ -61,10 +61,8 @@ static int xgene_reboot_probe(struct platform_device *pdev)
|
||||||
struct xgene_reboot_context *ctx;
|
struct xgene_reboot_context *ctx;
|
||||||
|
|
||||||
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
|
||||||
if (!ctx) {
|
if (!ctx)
|
||||||
dev_err(&pdev->dev, "out of memory for context\n");
|
return -ENOMEM;
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
ctx->csr = of_iomap(pdev->dev.of_node, 0);
|
ctx->csr = of_iomap(pdev->dev.of_node, 0);
|
||||||
if (!ctx->csr) {
|
if (!ctx->csr) {
|
||||||
|
|
Loading…
Reference in New Issue