Commit 571afb4c authored by Nishanth Menon's avatar Nishanth Menon Committed by Tony Lindgren

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 06c2d368 ("ARM: OMAP: DRA7:
Make use of omap_revision information for soc_is* calls")
Signed-off-by: default avatarNishanth Menon <nm@ti.com>
Tested-by: default avatarKeerthy <j-keerthy@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent eea08802
......@@ -65,6 +65,7 @@ static struct omap_id omap_ids[] __initdata = {
unsigned int omap_rev(void)
{
WARN_ON_ONCE(!omap_revision || omap_revision == -1);
return omap_revision;
}
EXPORT_SYMBOL(omap_rev);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment