Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'nios2-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2

Pull nios2 update from Ley Foon Tan:
"Use of_property_read_bool() instead of open-coding it"

* tag 'nios2-v4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
nios2: use of_property_read_bool

+9 -14
+4 -4
arch/nios2/include/asm/cpuinfo.h
··· 25 25 /* Core CPU configuration */ 26 26 char cpu_impl[12]; 27 27 u32 cpu_clock_freq; 28 - u32 mmu; 29 - u32 has_div; 30 - u32 has_mul; 31 - u32 has_mulx; 28 + bool mmu; 29 + bool has_div; 30 + bool has_mul; 31 + bool has_mulx; 32 32 33 33 /* CPU caches */ 34 34 u32 icache_line_size;
+5 -10
arch/nios2/kernel/cpuinfo.c
··· 41 41 return val; 42 42 } 43 43 44 - static inline u32 fcpu_has(struct device_node *cpu, const char *n) 45 - { 46 - return of_get_property(cpu, n, NULL) ? 1 : 0; 47 - } 48 - 49 44 void __init setup_cpuinfo(void) 50 45 { 51 46 struct device_node *cpu; ··· 51 56 if (!cpu) 52 57 panic("%s: No CPU found in devicetree!\n", __func__); 53 58 54 - if (!fcpu_has(cpu, "altr,has-initda")) 59 + if (!of_property_read_bool(cpu, "altr,has-initda")) 55 60 panic("initda instruction is unimplemented. Please update your " 56 61 "hardware system to have more than 4-byte line data " 57 62 "cache\n"); ··· 64 69 else 65 70 strcpy(cpuinfo.cpu_impl, "<unknown>"); 66 71 67 - cpuinfo.has_div = fcpu_has(cpu, "altr,has-div"); 68 - cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul"); 69 - cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx"); 70 - cpuinfo.mmu = fcpu_has(cpu, "altr,has-mmu"); 72 + cpuinfo.has_div = of_property_read_bool(cpu, "altr,has-div"); 73 + cpuinfo.has_mul = of_property_read_bool(cpu, "altr,has-mul"); 74 + cpuinfo.has_mulx = of_property_read_bool(cpu, "altr,has-mulx"); 75 + cpuinfo.mmu = of_property_read_bool(cpu, "altr,has-mmu"); 71 76 72 77 if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div) 73 78 err_cpu("DIV");