summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2019-12-18 21:23:04 +0300
committerThierry Reding <treding@nvidia.com>2020-01-10 17:59:43 +0300
commit02676345e9b31ad8907af3755960e3cfef575f8d (patch)
treeca8cff73d6e99a4b8ac6392fecbd1258000ab7d7 /drivers/soc
parent2d9ea1934f8ef0dfb862d103389562cc28b4fc03 (diff)
downloadlinux-02676345e9b31ad8907af3755960e3cfef575f8d.tar.xz
soc/tegra: fuse: Unmap registers once they are not needed anymore
Both Chip ID and strapping registers are now read out during of APB MISC initialization, the registers' mapping isn't needed anymore once registers are read. Hence let's unmap registers once they are not needed anymore, for consistency. Suggested-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/tegra/fuse/tegra-apbmisc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 6259390f68f4..4a737f15e401 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -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");
}