diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-03-23 12:15:22 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-03-23 12:15:22 +0100 |
commit | bb2873db3ef11e7b1299b1cca129f5d002e47f59 (patch) | |
tree | e53a1697f6ffb81d8f866ddadf3862ab0c04ceef /common | |
parent | 31343957ea42a9340345c17288e56cfa07304bb8 (diff) | |
parent | 176bd2605edfd7d64370736abe8c44833068788b (diff) | |
download | barebox-bb2873db3ef11e7b1299b1cca129f5d002e47f59.tar.gz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r-- | common/blspec.c | 4 | ||||
-rw-r--r-- | common/complete.c | 9 | ||||
-rw-r--r-- | common/image-fit.c | 6 | ||||
-rw-r--r-- | common/oftree.c | 14 | ||||
-rw-r--r-- | common/resource.c | 6 |
5 files changed, 20 insertions, 19 deletions
diff --git a/common/blspec.c b/common/blspec.c index c05d8a8297..ad80d7a8cd 100644 --- a/common/blspec.c +++ b/common/blspec.c @@ -729,7 +729,9 @@ static int blspec_scan_cdev(struct bootentries *bootentries, struct cdev *cdev) found += ret; } - rootpath = cdev_mount_default(cdev, NULL); + rootpath = cdev_get_mount_path(cdev); + if (!rootpath) + rootpath = cdev_mount_default(cdev, NULL); if (!IS_ERR(rootpath)) { ret = blspec_scan_directory(bootentries, rootpath); if (ret > 0) diff --git a/common/complete.c b/common/complete.c index ad630f4c95..e504b75606 100644 --- a/common/complete.c +++ b/common/complete.c @@ -101,14 +101,7 @@ static int path_command_complete(struct string_list *sl, char *instr) else strcat(tmp, " "); - /* This function is called - * after command_complete, - * so we check if a double - * entry exist */ - if (string_list_contains - (sl, tmp) == 0) { - string_list_add_sorted(sl, tmp); - } + string_list_add_sort_uniq(sl, tmp); } } diff --git a/common/image-fit.c b/common/image-fit.c index 538e61f51b..2c5ef7f687 100644 --- a/common/image-fit.c +++ b/common/image-fit.c @@ -230,11 +230,9 @@ static struct digest *fit_alloc_digest(struct device_node *sig_node, return ERR_PTR(-EINVAL); } - if (strcmp(algo_name, "sha1,rsa2048") == 0) { + if (strncmp(algo_name, "sha1,", 5) == 0) { algo = HASH_ALGO_SHA1; - } else if (strcmp(algo_name, "sha256,rsa2048") == 0) { - algo = HASH_ALGO_SHA256; - } else if (strcmp(algo_name, "sha256,rsa4096") == 0) { + } else if (strncmp(algo_name, "sha256,", 7) == 0) { algo = HASH_ALGO_SHA256; } else { pr_err("unknown algo %s\n", algo_name); diff --git a/common/oftree.c b/common/oftree.c index 075b9d6b8b..60d4327155 100644 --- a/common/oftree.c +++ b/common/oftree.c @@ -319,21 +319,27 @@ int of_fix_tree(struct device_node *node) struct fdt_header *of_get_fixed_tree(struct device_node *node) { int ret; - struct fdt_header *fdt; + struct fdt_header *fdt = NULL; + struct device_node *freenp = NULL; if (!node) { node = of_get_root_node(); if (!node) return NULL; + + freenp = node = of_copy_node(NULL, node); + if (!node) + return NULL; } ret = of_fix_tree(node); if (ret) - return NULL; + goto out; fdt = of_flatten_dtb(node); - if (!fdt) - return NULL; + +out: + of_delete_node(freenp); return fdt; } diff --git a/common/resource.c b/common/resource.c index 92fe96252f..ff4318a0d7 100644 --- a/common/resource.c +++ b/common/resource.c @@ -61,12 +61,14 @@ struct resource *__request_region(struct resource *parent, goto ok; if (start > r->end) continue; - debug("%s: 0x%08llx:0x%08llx conflicts with 0x%08llx:0x%08llx\n", + debug("%s: 0x%08llx:0x%08llx (%s) conflicts with 0x%08llx:0x%08llx (%s)\n", __func__, (unsigned long long)start, (unsigned long long)end, + name, (unsigned long long)r->start, - (unsigned long long)r->end); + (unsigned long long)r->end, + r->name); return ERR_PTR(-EBUSY); } |