summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2016-04-01 17:53:07 -0500
committerTony Lindgren <tony@atomide.com>2016-04-08 09:02:39 -0700
commit571afb4c8a4bbe88541364e7f6827340562f2736 (patch)
tree660910cb930bfa3bfd3711ccce6b0a73f9a6fd95 /arch/arm/mach-omap2
parenteea08802f586acd6aef377d1b4a541821013cc0b (diff)
downloadop-kernel-dev-571afb4c8a4bbe88541364e7f6827340562f2736.zip
op-kernel-dev-571afb4c8a4bbe88541364e7f6827340562f2736.tar.gz
ARM: OMAP: Catch callers of revision information prior to it being populated
omap_rev is used to detect various SoC types, however any misuse of the usage by invoking it earlier than it being populated will result in invalid results. Lets flag them as early as possible to prevent unintended side effects taking place. We get 0 if it is uninitialized and -1 when detection is done using device tree (as the case was for DRA7 as the case was prior to commit 06c2d368fc36 ("ARM: OMAP: DRA7: Make use of omap_revision information for soc_is* calls") Signed-off-by: Nishanth Menon <nm@ti.com> Tested-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/id.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index d85c249..75fb6c0 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -46,6 +46,7 @@ u32 omap_features;
unsigned int omap_rev(void)
{
+ WARN_ON_ONCE(!omap_revision || omap_revision == -1);
return omap_revision;
}
EXPORT_SYMBOL(omap_rev);
OpenPOWER on IntegriCloud