projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae0f679
)
ARM: OMAP2+: id: cache omap_type value
author
Tero Kristo
<t-kristo@ti.com>
Mon, 9 Feb 2015 14:17:38 +0000
(16:17 +0200)
committer
Tero Kristo
<t-kristo@ti.com>
Tue, 31 Mar 2015 18:26:55 +0000
(21:26 +0300)
There is no need to read the register with every invocation of the function,
as the value is constant. Thus, cache the value in a static variable.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
arch/arm/mach-omap2/id.c
patch
|
blob
|
blame
|
history
diff --git
a/arch/arm/mach-omap2/id.c
b/arch/arm/mach-omap2/id.c
index 2a2f4d56e4c85ea599b295a10d09c2bf922bdc79..f8121dbc9d487bc1a85dc0ed091e216d73517ea8 100644
(file)
--- a/
arch/arm/mach-omap2/id.c
+++ b/
arch/arm/mach-omap2/id.c
@@
-52,7
+52,10
@@
EXPORT_SYMBOL(omap_rev);
int omap_type(void)
{
- u32 val = 0;
+ static u32 val = OMAP2_DEVICETYPE_MASK;
+
+ if (val < OMAP2_DEVICETYPE_MASK)
+ return val;
if (cpu_is_omap24xx()) {
val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);