From owner-svn-src-head@freebsd.org Fri Jun 2 14:01:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B7C1BF851B; Fri, 2 Jun 2017 14:01:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAE0933FE; Fri, 2 Jun 2017 14:01:18 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v52E1HvG052658; Fri, 2 Jun 2017 14:01:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v52E1H1k052657; Fri, 2 Jun 2017 14:01:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201706021401.v52E1H1k052657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 2 Jun 2017 14:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319494 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jun 2017 14:01:19 -0000 Author: andrew Date: Fri Jun 2 14:01:17 2017 New Revision: 319494 URL: https://svnweb.freebsd.org/changeset/base/319494 Log: Fix device lookup of for the stdout-path chosen property. The stdout-path chosen property may include the serial connection details, e.g. the baud rate. When passing the device to OF_finddevice we need to strip off this information as it will cause the lookup to fail. Reviewed by: emaste, manu Differential Revision: https://reviews.freebsd.org/D6846 Modified: head/sys/dev/uart/uart_bus_fdt.c Modified: head/sys/dev/uart/uart_bus_fdt.c ============================================================================== --- head/sys/dev/uart/uart_bus_fdt.c Fri Jun 2 13:33:50 2017 (r319493) +++ head/sys/dev/uart/uart_bus_fdt.c Fri Jun 2 14:01:17 2017 (r319494) @@ -117,9 +117,18 @@ static int phandle_chosen_propdev(phandle_t chosen, const char *name, phandle_t *node) { char buf[64]; + char *sep; if (OF_getprop(chosen, name, buf, sizeof(buf)) <= 0) return (ENXIO); + /* + * stdout-path may have a ':' to separate the device from the + * connection settings. Split the string so we just pass the former + * to OF_finddevice. + */ + sep = strchr(buf, ':'); + if (sep != NULL) + *sep = '\0'; if ((*node = OF_finddevice(buf)) == -1) return (ENXIO);