soc/tegra: fuse: Unmap registers once they are not needed anymore
[sfrench/cifs-2.6.git] / drivers / soc / tegra / fuse / tegra-apbmisc.c
index 6259390f68f40ba080f0c3f1b7f785b7b29f0f29..4a737f15e4018405bf3f09d6b32a81fb82ffc37d 100644 (file)
@@ -158,16 +158,20 @@ void __init tegra_init_apbmisc(void)
        }
 
        apbmisc_base = ioremap_nocache(apbmisc.start, resource_size(&apbmisc));
-       if (!apbmisc_base)
+       if (!apbmisc_base) {
                pr_err("failed to map APBMISC registers\n");
-       else
+       } else {
                chipid = readl_relaxed(apbmisc_base + 4);
+               iounmap(apbmisc_base);
+       }
 
        strapping_base = ioremap_nocache(straps.start, resource_size(&straps));
-       if (!strapping_base)
+       if (!strapping_base) {
                pr_err("failed to map strapping options registers\n");
-       else
+       } else {
                strapping = readl_relaxed(strapping_base);
+               iounmap(strapping_base);
+       }
 
        long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code");
 }