Commit 1f1607db authored by Thierry Reding's avatar Thierry Reding
Browse files

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: default avatarThierry Reding <treding@nvidia.com>
parent 83468fe2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -38,17 +38,17 @@ static void __iomem *strapping_base;
static bool long_ram_code;

u32 tegra_read_chipid(void)
{
	return readl_relaxed(apbmisc_base + 4);
}

u8 tegra_get_chip_id(void)
{
	if (!apbmisc_base) {
		WARN(1, "Tegra Chip ID not yet available\n");
		return 0;
	}

	return readl_relaxed(apbmisc_base + 4);
}

u8 tegra_get_chip_id(void)
{
	return (tegra_read_chipid() >> 8) & 0xff;
}