mirror of
https://github.com/torvalds/linux.git
synced 2024-11-17 09:31:50 +00:00
ARM: shmobile: rcar-gen2: Cache Mode Monitor Register Value
The MD pins are sampled at reset time, hence the read value will always be the same, and we can avoid the overhead of ioremapping the register on every read. Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
This commit is contained in:
parent
f05b4b5284
commit
835d737d66
@ -30,12 +30,16 @@
|
||||
|
||||
u32 rcar_gen2_read_mode_pins(void)
|
||||
{
|
||||
void __iomem *modemr = ioremap_nocache(MODEMR, 4);
|
||||
u32 mode;
|
||||
static u32 mode;
|
||||
static bool mode_valid;
|
||||
|
||||
if (!mode_valid) {
|
||||
void __iomem *modemr = ioremap_nocache(MODEMR, 4);
|
||||
BUG_ON(!modemr);
|
||||
mode = ioread32(modemr);
|
||||
iounmap(modemr);
|
||||
mode_valid = true;
|
||||
}
|
||||
|
||||
return mode;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user