diff options
author | Tero Kristo <t-kristo@ti.com> | 2015-02-09 09:17:38 -0500 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2015-03-31 14:26:55 -0400 |
commit | 23d240d661f42214bd372c0e5b21afaf71b9329c (patch) | |
tree | 8cc47acbe8552433cd93c9dc0e7ff5e19abc08bd /arch/arm | |
parent | ae0f6798474053eb76863fa9b3befd9deea58ba6 (diff) |
ARM: OMAP2+: id: cache omap_type value
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/id.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c index 2a2f4d56e4c8..f8121dbc9d48 100644 --- a/arch/arm/mach-omap2/id.c +++ b/arch/arm/mach-omap2/id.c | |||
@@ -52,7 +52,10 @@ EXPORT_SYMBOL(omap_rev); | |||
52 | 52 | ||
53 | int omap_type(void) | 53 | int omap_type(void) |
54 | { | 54 | { |
55 | u32 val = 0; | 55 | static u32 val = OMAP2_DEVICETYPE_MASK; |
56 | |||
57 | if (val < OMAP2_DEVICETYPE_MASK) | ||
58 | return val; | ||
56 | 59 | ||
57 | if (cpu_is_omap24xx()) { | 60 | if (cpu_is_omap24xx()) { |
58 | val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); | 61 | val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS); |