diff options
author | Linus Torvalds | 2016-10-10 11:31:19 -0700 |
---|---|---|
committer | Linus Torvalds | 2016-10-10 11:31:19 -0700 |
commit | ae50a840e779d48aa4dea2aaec1778f6b3f1d67f (patch) | |
tree | 665faaaed4333b3a2d83ca2411a7cab9354fd5cd /arch/nios2/kernel | |
parent | 057a056ced1ee7e000bad2a5c88241502747d350 (diff) | |
parent | 476080a79367b950cb860ccf8a3a53fd24f6cccc (diff) |
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
Diffstat (limited to 'arch/nios2/kernel')
-rw-r--r-- | arch/nios2/kernel/cpuinfo.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/arch/nios2/kernel/cpuinfo.c b/arch/nios2/kernel/cpuinfo.c index 1d96de0bd4aa..1cccc36877bc 100644 --- a/arch/nios2/kernel/cpuinfo.c +++ b/arch/nios2/kernel/cpuinfo.c @@ -41,11 +41,6 @@ static inline u32 fcpu(struct device_node *cpu, const char *n) return val; } -static inline u32 fcpu_has(struct device_node *cpu, const char *n) -{ - return of_get_property(cpu, n, NULL) ? 1 : 0; -} - void __init setup_cpuinfo(void) { struct device_node *cpu; @@ -56,7 +51,7 @@ void __init setup_cpuinfo(void) if (!cpu) panic("%s: No CPU found in devicetree!\n", __func__); - if (!fcpu_has(cpu, "altr,has-initda")) + if (!of_property_read_bool(cpu, "altr,has-initda")) panic("initda instruction is unimplemented. Please update your " "hardware system to have more than 4-byte line data " "cache\n"); @@ -69,10 +64,10 @@ void __init setup_cpuinfo(void) else strcpy(cpuinfo.cpu_impl, "<unknown>"); - cpuinfo.has_div = fcpu_has(cpu, "altr,has-div"); - cpuinfo.has_mul = fcpu_has(cpu, "altr,has-mul"); - cpuinfo.has_mulx = fcpu_has(cpu, "altr,has-mulx"); - cpuinfo.mmu = fcpu_has(cpu, "altr,has-mmu"); + cpuinfo.has_div = of_property_read_bool(cpu, "altr,has-div"); + cpuinfo.has_mul = of_property_read_bool(cpu, "altr,has-mul"); + cpuinfo.has_mulx = of_property_read_bool(cpu, "altr,has-mulx"); + cpuinfo.mmu = of_property_read_bool(cpu, "altr,has-mmu"); if (IS_ENABLED(CONFIG_NIOS2_HW_DIV_SUPPORT) && !cpuinfo.has_div) err_cpu("DIV"); |