From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753219AbcAPVjq (ORCPT ); Sat, 16 Jan 2016 16:39:46 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33503 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752899AbcAPVir (ORCPT ); Sat, 16 Jan 2016 16:38:47 -0500 From: Peter Hurley To: Greg Kroah-Hartman , Rob Herring , Grant Likely Cc: Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Kevin Cernekee , Jon Hunter , Paul Burton , Masahiro Yamada , Sebastian Frias , Peter Hurley Subject: [PATCH v5 10/11] of: earlycon: Log more helpful message if stdout-path node not found Date: Sat, 16 Jan 2016 13:37:23 -0800 Message-Id: <1452980244-20512-11-git-send-email-peter@hurleysoftware.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1452980244-20512-1-git-send-email-peter@hurleysoftware.com> References: <1452627672-9482-1-git-send-email-peter@hurleysoftware.com> <1452980244-20512-1-git-send-email-peter@hurleysoftware.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Earlycon may fail to initialize for a variety of reasons, most of which log the default early param message. If the stdout-path node is not found, log the path which was not found (and suppress the default early param message). Acked-by: Rob Herring Signed-off-by: Peter Hurley --- drivers/of/fdt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 918809e..e2295b2 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -820,11 +820,14 @@ static int __init early_init_dt_scan_chosen_serial(void) q = strchrnul(p, ':'); if (*q != '\0') options = q + 1; + l = q - p; /* Get the node specified by stdout-path */ - offset = fdt_path_offset_namelen(fdt, p, q - p); - if (offset < 0) - return -ENODEV; + offset = fdt_path_offset_namelen(fdt, p, l); + if (offset < 0) { + pr_warn("earlycon: stdout-path %.*s not found\n", l, p); + return 0; + } for (match = __earlycon_table; match < __earlycon_table_end; match++) { if (!match->compatible[0]) -- 2.7.0