From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754816AbbDHVY3 (ORCPT ); Wed, 8 Apr 2015 17:24:29 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:33006 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753288AbbDHVY0 (ORCPT ); Wed, 8 Apr 2015 17:24:26 -0400 MIME-Version: 1.0 In-Reply-To: <1428515119-25248-2-git-send-email-peter@hurleysoftware.com> References: <1428515119-25248-1-git-send-email-peter@hurleysoftware.com> <1428515119-25248-2-git-send-email-peter@hurleysoftware.com> From: Rob Herring Date: Wed, 8 Apr 2015 16:24:04 -0500 Message-ID: Subject: Re: [PATCH v3 01/13] of: earlycon: Fix 'stdout-path' with ':' path terminator To: Peter Hurley Cc: Greg Kroah-Hartman , Rob Herring , Grant Likely , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kevin Cernekee , Leif Lindholm Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 8, 2015 at 12:45 PM, Peter Hurley wrote: > stdout-path defines ':' as a path terminator and commit 75c28c09af99a > ("of: add optional options parameter to of_find_node_by_path()") added > the necessary support to parse paths terminated with ':'. > commit 7914a7c5651a5 ("of: support passing console options with > stdout-path") added options string support to the stdout-path property, > which broke earlycon. > > Add the same support to earlycon to process 'stdout-path' properties > which contain an options string. > > Requires: "libfdt: Add fdt_path_offset_namelen()" Since David has applied this, we can cherrypick that commit for the kernel copy. Ideally, we would do a dtc sync, but it's not going to happen for 4.1. Rob > Cc: Leif Lindholm > Signed-off-by: Peter Hurley > --- > drivers/of/fdt.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c > index 3a896c9..7cef9f9 100644 > --- a/drivers/of/fdt.c > +++ b/drivers/of/fdt.c > @@ -765,7 +765,7 @@ extern struct of_device_id __earlycon_of_table[]; > static int __init early_init_dt_scan_chosen_serial(void) > { > int offset; > - const char *p; > + const char *p, *q; > int l; > const struct of_device_id *match = __earlycon_of_table; > const void *fdt = initial_boot_params; > @@ -782,8 +782,10 @@ static int __init early_init_dt_scan_chosen_serial(void) > if (!p || !l) > return -ENOENT; > > + q = strchrnul(p, ':'); > + > /* Get the node specified by stdout-path */ > - offset = fdt_path_offset(fdt, p); > + offset = fdt_path_offset_namelen(fdt, p, (int)(q - p)); > if (offset < 0) > return -ENODEV; > > -- > 2.3.5 >