treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / nios2 / kernel / prom.c
blob8d98af5c7201bb34570d97876d53d663e9068964
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Device tree support
5 * Copyright (C) 2013, 2015 Altera Corporation
6 * Copyright (C) 2010 Thomas Chou <thomas@wytron.com.tw>
8 * Based on MIPS support for CONFIG_OF device tree support
10 * Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
13 #include <linux/init.h>
14 #include <linux/types.h>
15 #include <linux/memblock.h>
16 #include <linux/of.h>
17 #include <linux/of_fdt.h>
18 #include <linux/io.h>
20 #include <asm/sections.h>
22 void __init early_init_devtree(void *params)
24 __be32 *dtb = (u32 *)__dtb_start;
25 #if defined(CONFIG_NIOS2_DTB_AT_PHYS_ADDR)
26 if (be32_to_cpup((__be32 *)CONFIG_NIOS2_DTB_PHYS_ADDR) ==
27 OF_DT_HEADER) {
28 params = (void *)CONFIG_NIOS2_DTB_PHYS_ADDR;
29 early_init_dt_scan(params);
30 return;
32 #endif
33 if (be32_to_cpu((__be32) *dtb) == OF_DT_HEADER)
34 params = (void *)__dtb_start;
36 early_init_dt_scan(params);