From patchwork Thu Oct 3 12:50:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 2982681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 38611BFF0B for ; Thu, 3 Oct 2013 12:51:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 987572018A for ; Thu, 3 Oct 2013 12:51:35 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38B6720181 for ; Thu, 3 Oct 2013 12:51:34 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRiNL-0004YD-QT; Thu, 03 Oct 2013 12:51:27 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRiNI-0001hH-HN; Thu, 03 Oct 2013 12:51:24 +0000 Received: from [2001:41c8:1:5384::2] (helo=cassiel.sirena.org.uk) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VRiNF-0001gO-0p for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2013 12:51:22 +0000 Received: from cpc11-sgyl31-2-0-cust68.sgyl.cable.virginmedia.com ([94.175.92.69] helo=debutante.sirena.org.uk) by cassiel.sirena.org.uk with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1VRiMj-0004az-2g; Thu, 03 Oct 2013 13:50:50 +0100 Received: from broonie by debutante.sirena.org.uk with local (Exim 4.80) (envelope-from ) id 1VRiMd-0004kT-Uc; Thu, 03 Oct 2013 13:50:43 +0100 From: Mark Brown To: Rob Herring , Russell King Date: Thu, 3 Oct 2013 13:50:33 +0100 Message-Id: <1380804633-14130-1-git-send-email-broonie@kernel.org> X-Mailer: git-send-email 1.8.4.rc3 X-SA-Exim-Connect-IP: 94.175.92.69 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Subject: [PATCH] arm: Fix conversion to early_init_dt_scan() for non-DT platforms X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:57:07 +0000) X-SA-Exim-Scanned: Yes (on cassiel.sirena.org.uk) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131003_085121_381493_117F8F46 X-CRM114-Status: GOOD ( 13.60 ) X-Spam-Score: -1.1 (-) Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Brown X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mark Brown Commit 67a964490bfd14 (arm: use early_init_dt_scan) in the OF tree in -next converts ARM to use early_init_dt_scan(), factoring out some common code. However it ignores the return value of the function meaning that on non-DT platforms the kernel fails to boot as it attempts to configure itself using DT. Fix this by adding the appropriate return value check. Signed-off-by: Mark Brown --- arch/arm/kernel/devtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 04050f7..67f4ebe 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -198,7 +198,8 @@ const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) if (!dt_phys) return NULL; - early_init_dt_scan(phys_to_virt(dt_phys)); + if (!early_init_dt_scan(phys_to_virt(dt_phys))) + return NULL; /* Search the mdescs for the 'best' compatible value match */ dt_root = of_get_flat_dt_root();