aboutsummaryrefslogtreecommitdiff
path: root/hw/npu2.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/npu2.c')
-rw-r--r--hw/npu2.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/hw/npu2.c b/hw/npu2.c
index 68a5382..d6b634d 100644
--- a/hw/npu2.c
+++ b/hw/npu2.c
@@ -605,20 +605,9 @@ static void npu2_append_phandle(struct dt_node *dn,
static struct dt_node *npu2_create_memory_dn(uint64_t addr, uint64_t size)
{
struct dt_node *mem;
- char *name;
- size_t namesz;
static u32 chip_id = 255;
- /*
- * Find and return the node if it already exists.
- */
- namesz = sizeof("memory@") + STR_MAX_CHARS(addr);
- name = malloc(namesz);
- if (!name)
- return NULL;
- snprintf(name, namesz, "memory@%llx", (long long)addr);
- mem = dt_find_by_name(dt_root, name);
- free(name);
+ mem = dt_find_by_name_addr(dt_root, "memory", addr);
if (mem)
return mem;