Revision 7d5fd108

b/device_tree.c
132 132
    return r;
133 133
}
134 134

  
135
uint32_t qemu_devtree_get_phandle(void *fdt, const char *path)
136
{
137
    uint32_t r;
138

  
139
    r = fdt_get_phandle(fdt, findnode_nofail(fdt, path));
140
    if (r <= 0) {
141
        fprintf(stderr, "%s: Couldn't get phandle for %s: %s\n", __func__,
142
                path, fdt_strerror(r));
143
        exit(1);
144
    }
145

  
146
    return r;
147
}
148

  
135 149
int qemu_devtree_setprop_phandle(void *fdt, const char *node_path,
136 150
                                 const char *property,
137 151
                                 const char *target_node_path)
138 152
{
139
    uint32_t phandle = fdt_get_phandle(fdt, findnode_nofail(fdt, target_node_path));
153
    uint32_t phandle = qemu_devtree_get_phandle(fdt, target_node_path);
140 154
    return qemu_devtree_setprop_cell(fdt, node_path, property, phandle);
141 155
}
142 156

  
b/device_tree.h
25 25
int qemu_devtree_setprop_phandle(void *fdt, const char *node_path,
26 26
                                 const char *property,
27 27
                                 const char *target_node_path);
28
uint32_t qemu_devtree_get_phandle(void *fdt, const char *path);
28 29
int qemu_devtree_nop_node(void *fdt, const char *node_path);
29 30
int qemu_devtree_add_subnode(void *fdt, const char *name);
30 31

  

Also available in: Unified diff