From owner-svn-src-projects@FreeBSD.ORG Tue May 17 12:47:38 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69A1E106564A; Tue, 17 May 2011 12:47:38 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59F928FC12; Tue, 17 May 2011 12:47:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4HClcQE031546; Tue, 17 May 2011 12:47:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4HClchO031544; Tue, 17 May 2011 12:47:38 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105171247.p4HClchO031544@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 17 May 2011 12:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222022 - projects/pseries/dev/ofw X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2011 12:47:38 -0000 Author: nwhitehorn Date: Tue May 17 12:47:38 2011 New Revision: 222022 URL: http://svn.freebsd.org/changeset/base/222022 Log: Make the primary name of the OF console device /dev/ofwcons, and only alias it to the contents of the output property if it is defined. This avoids a panic when booting machines (QEMU) where the output-device property is not defined. Since output-device is free-form and potentially conflicts with other entries in /dev, I also am not sure we should be doing the aliasing at all. Modified: projects/pseries/dev/ofw/ofw_console.c Modified: projects/pseries/dev/ofw/ofw_console.c ============================================================================== --- projects/pseries/dev/ofw/ofw_console.c Tue May 17 11:56:50 2011 (r222021) +++ projects/pseries/dev/ofw/ofw_console.c Tue May 17 12:47:38 2011 (r222022) @@ -87,17 +87,19 @@ cn_drvinit(void *unused) if (ofw_consdev.cn_pri != CN_DEAD && ofw_consdev.cn_name[0] != '\0') { - if ((options = OF_finddevice("/options")) == -1 || - OF_getprop(options, "output-device", output, - sizeof(output)) == -1) - return; + tp = tty_alloc(&ofw_ttydevsw, NULL); + tty_makedev(tp, NULL, "%s", "ofwcons"); + /* * XXX: This is a hack and it may result in two /dev/ttya * XXX: devices on platforms where the sab driver works. */ - tp = tty_alloc(&ofw_ttydevsw, NULL); - tty_makedev(tp, NULL, "%s", output); - tty_makealias(tp, "ofwcons"); + if ((options = OF_finddevice("/options")) == -1 || + OF_getprop(options, "output-device", output, + sizeof(output)) == -1) + return; + if (strlen(output) > 0) + tty_makealias(tp, output); } }