Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23d240d6 authored by Tero Kristo's avatar Tero Kristo
Browse files

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: default avatarTero Kristo <t-kristo@ti.com>
parent ae0f6798
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -52,7 +52,10 @@ EXPORT_SYMBOL(omap_rev);


int omap_type(void)
int omap_type(void)
{
{
	u32 val = 0;
	static u32 val = OMAP2_DEVICETYPE_MASK;

	if (val < OMAP2_DEVICETYPE_MASK)
		return val;


	if (cpu_is_omap24xx()) {
	if (cpu_is_omap24xx()) {
		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);