From: Tero Kristo Date: Mon, 9 Feb 2015 14:17:38 +0000 (+0200) Subject: ARM: OMAP2+: id: cache omap_type value X-Git-Tag: v4.1-rc1~45^2~3^2^2~12 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=23d240d661f42214bd372c0e5b21afaf71b9329c;p=karo-tx-linux.git 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 --- 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); 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);