Browse Source

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>
Arvind Yadav 9 years ago
parent
commit
896af83ef6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/power/reset/xgene-reboot.c

+ 3 - 1
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;
 }