From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C48B9C00144 for ; Mon, 1 Aug 2022 10:03:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9F74B84488; Mon, 1 Aug 2022 12:03:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="cJAoNKfT"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2562284488; Mon, 1 Aug 2022 12:03:21 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C604D8414A for ; Mon, 1 Aug 2022 12:03:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 55513B80EC3; Mon, 1 Aug 2022 10:03:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D70EDC433D6; Mon, 1 Aug 2022 10:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659348197; bh=CMLJUr44c3yp2MZ1Zdm/H2SEJYmqg0EH64YEsz7sy9I=; h=From:To:Cc:Subject:Date:From; b=cJAoNKfT984k+y67EXfkluiWEYCEisRgnRvYL29LQQo3wr8ts9bseIqKU8ceTe/kw A2g5yukxnMp2bWbdBHtdkQmbsb6RlBcrKNOoklHS2BuHhIOHIdpFk//5Yn27zQkH6g K6kxNg3OoJKUasId/UoSkJfI3vntI0I8COcorIW4Ybql11Z+aXcwGl9E74UnwrUHRR hFAYD34vXETjcyVWhd7EUGTMr9lhtGOEt28uR96GwO5gce30aCISAnvqqWPgzfjH0a 59qnJu7K+7Oz5DI9Wk9TAcXp0KOHcrLIBW8HFaYM2/zqAs/ljTB36IPFIVSZH2wjhD oxHawakRRd9iw== Received: by pali.im (Postfix) id A963575F; Mon, 1 Aug 2022 12:03:13 +0200 (CEST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Stefan Roese , =?UTF-8?q?Marek=20Beh=C3=BAn?= Cc: u-boot@lists.denx.de Subject: [PATCH 1/2] arm: mvebu: turris_omnia: Do not fail in fixup_mtd_partitions when partitions do not exist Date: Mon, 1 Aug 2022 12:02:19 +0200 Message-Id: <20220801100220.24017-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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 --- board/CZ.NIC/turris_omnia/turris_omnia.c | 9 ++++----- 1 file 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 e262ea1aba51..d836ac94ec29 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) -- 2.20.1