mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
ae0f679847
commit
23d240d661
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue