aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2017-06-26 11:21:17 -0400
committerThierry Reding <treding@nvidia.com>2017-12-13 06:43:30 -0500
commit1f1607dbd9f6efc22f06e16fc11675dd6323aaab (patch)
treee86c9849e7bfa578264ac3fed41e65d984299d08
parent83468fe259bf827f350b118f25bce99dc0bdf597 (diff)
soc/tegra: fuse: Move register mapping check
The tegra_read_chipid() function can be called from places other than tegra_get_chip_id(), so the check for a valid mapping of the MISC registers needs to be moved to tegra_read_chipid() to catch all potential accesses. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/soc/tegra/fuse/tegra-apbmisc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 5b18f6ffa45c..b1f8b23277b9 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -39,16 +39,16 @@ static bool long_ram_code;
39 39
40u32 tegra_read_chipid(void) 40u32 tegra_read_chipid(void)
41{ 41{
42 return readl_relaxed(apbmisc_base + 4);
43}
44
45u8 tegra_get_chip_id(void)
46{
47 if (!apbmisc_base) { 42 if (!apbmisc_base) {
48 WARN(1, "Tegra Chip ID not yet available\n"); 43 WARN(1, "Tegra Chip ID not yet available\n");
49 return 0; 44 return 0;
50 } 45 }
51 46
47 return readl_relaxed(apbmisc_base + 4);
48}
49
50u8 tegra_get_chip_id(void)
51{
52 return (tegra_read_chipid() >> 8) & 0xff; 52 return (tegra_read_chipid() >> 8) & 0xff;
53} 53}
54 54