mirror of https://gitee.com/openkylin/qemu.git
powerpc: fix compilation with CONFIG_FDT undefined
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
04088adbe0
commit
dbf916d85b
|
@ -33,22 +33,20 @@ static int bamboo_load_device_tree(target_phys_addr_t addr,
|
||||||
target_phys_addr_t initrd_size,
|
target_phys_addr_t initrd_size,
|
||||||
const char *kernel_cmdline)
|
const char *kernel_cmdline)
|
||||||
{
|
{
|
||||||
void *fdt = NULL;
|
int ret = -1;
|
||||||
#ifdef CONFIG_FDT
|
#ifdef CONFIG_FDT
|
||||||
uint32_t mem_reg_property[] = { 0, 0, ramsize };
|
uint32_t mem_reg_property[] = { 0, 0, ramsize };
|
||||||
char *filename;
|
char *filename;
|
||||||
int fdt_size;
|
int fdt_size;
|
||||||
int ret;
|
void *fdt;
|
||||||
|
|
||||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
ret = -1;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
fdt = load_device_tree(filename, &fdt_size);
|
fdt = load_device_tree(filename, &fdt_size);
|
||||||
qemu_free(filename);
|
qemu_free(filename);
|
||||||
if (fdt == NULL) {
|
if (fdt == NULL) {
|
||||||
ret = -1;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,22 +78,20 @@ static int mpc8544_load_device_tree(target_phys_addr_t addr,
|
||||||
target_phys_addr_t initrd_size,
|
target_phys_addr_t initrd_size,
|
||||||
const char *kernel_cmdline)
|
const char *kernel_cmdline)
|
||||||
{
|
{
|
||||||
void *fdt = NULL;
|
int ret = -1;
|
||||||
#ifdef CONFIG_FDT
|
#ifdef CONFIG_FDT
|
||||||
uint32_t mem_reg_property[] = {0, ramsize};
|
uint32_t mem_reg_property[] = {0, ramsize};
|
||||||
char *filename;
|
char *filename;
|
||||||
int fdt_size;
|
int fdt_size;
|
||||||
int ret;
|
void *fdt;
|
||||||
|
|
||||||
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
ret = -1;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
fdt = load_device_tree(filename, &fdt_size);
|
fdt = load_device_tree(filename, &fdt_size);
|
||||||
qemu_free(filename);
|
qemu_free(filename);
|
||||||
if (fdt == NULL) {
|
if (fdt == NULL) {
|
||||||
ret = -1;
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue