summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2016-09-14 13:55:39 +0300
committerSebastian Reichel <sre@kernel.org>2016-09-19 22:24:06 +0300
commit896af83ef69b0a325816fe270440baa27238f531 (patch)
treef1503ac7e49a0ce1a482717db28d190c0a298c0d
parentf04f7aef7f6aafdc0ba54c6b9670cd11f9d9200a (diff)
downloadlinux-896af83ef69b0a325816fe270440baa27238f531.tar.xz
power: reset: xgene-reboot: Unmap region obtained by of_iomap
Free memory mapping, if probe is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
-rw-r--r--drivers/power/reset/xgene-reboot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c
index f07e93c97ba3..73c3d93e5318 100644
--- a/drivers/power/reset/xgene-reboot.c
+++ b/drivers/power/reset/xgene-reboot.c
@@ -81,8 +81,10 @@ static int xgene_reboot_probe(struct platform_device *pdev)
ctx->restart_handler.notifier_call = xgene_restart_handler;
ctx->restart_handler.priority = 128;
err = register_restart_handler(&ctx->restart_handler);
- if (err)
+ if (err) {
+ iounmap(ctx->csr);
dev_err(dev, "cannot register restart handler (err=%d)\n", err);
+ }
return err;
}