Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -5
+5 -5
drivers/soc/tegra/fuse/tegra-apbmisc.c
··· 39 39 40 40 u32 tegra_read_chipid(void) 41 41 { 42 - return readl_relaxed(apbmisc_base + 4); 43 - } 44 - 45 - u8 tegra_get_chip_id(void) 46 - { 47 42 if (!apbmisc_base) { 48 43 WARN(1, "Tegra Chip ID not yet available\n"); 49 44 return 0; 50 45 } 51 46 47 + return readl_relaxed(apbmisc_base + 4); 48 + } 49 + 50 + u8 tegra_get_chip_id(void) 51 + { 52 52 return (tegra_read_chipid() >> 8) & 0xff; 53 53 } 54 54