From b29e9f5e64fb90d2e4be1c7ef8c925b56669c74a Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 21 Apr 2007 10:47:29 +0100 Subject: [ARM] mm 5: Use mem_types table in ioremap We really want to be using the memory type table in ioremap, so we only have to do the CPU type fixups in one place. Signed-off-by: Russell King --- arch/arm/mm/mmu.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'arch/arm/mm/mmu.c') diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 5821e67cf8c..6cb80b4973d 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -176,14 +176,7 @@ void adjust_cr(unsigned long mask, unsigned long set) } #endif -struct mem_type { - unsigned int prot_pte; - unsigned int prot_l1; - unsigned int prot_sect; - unsigned int domain; -}; - -static struct mem_type mem_types[] __initdata = { +static struct mem_type mem_types[] = { [MT_DEVICE] = { .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | L_PTE_WRITE, @@ -237,6 +230,11 @@ static struct mem_type mem_types[] __initdata = { } }; +const struct mem_type *get_mem_type(unsigned int type) +{ + return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL; +} + /* * Adjust the PMD section entries according to the CPU in use. */ -- cgit v1.2.3