diff options
author | Pali Rohár <pali@kernel.org> | 2022-08-01 12:02:19 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-08-09 08:57:23 +0200 |
commit | 37af2c7b296c66bd463943a3193df3c5e085a738 (patch) | |
tree | 02ad1934795dca5bb2db80365f56b80715d434cd /board | |
parent | 1da53ae26afc4f084cf35fea706090fa03dc8475 (diff) | |
download | u-boot-37af2c7b296c66bd463943a3193df3c5e085a738.zip u-boot-37af2c7b296c66bd463943a3193df3c5e085a738.tar.gz u-boot-37af2c7b296c66bd463943a3193df3c5e085a738.tar.bz2 |
arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist
All partitions are created by fixup_mtd_partitions() function, so they do
not have to exist just for their removal need.
Fixes: 92f36c8e74c1 ("arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB")
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Marek Behún <kabel@kernel.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/CZ.NIC/turris_omnia/turris_omnia.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index a7c1c1f..796c55f 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -974,11 +974,10 @@ static bool fixup_mtd_partitions(void *blob, int offset, struct mtd_info *mtd) int parts; parts = fdt_subnode_offset(blob, offset, "partitions"); - if (parts < 0) - return false; - - if (fdt_del_node(blob, parts) < 0) - return false; + if (parts >= 0) { + if (fdt_del_node(blob, parts) < 0) + return false; + } parts = fdt_add_subnode(blob, offset, "partitions"); if (parts < 0) |