Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 2009 16:43:35 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Dimitry Andric <dimitry@andric.com>
Cc:        freebsd-stable@freebsd.org, Andrew Thompson <thompsa@freebsd.org>
Subject:   Re: Console has no name?
Message-ID:  <200910311643.36862.hselasky@c2i.net>
In-Reply-To: <4AEC4F81.7010404@andric.com>
References:  <4AEC3823.9000204@andric.com> <4AEC4F81.7010404@andric.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Saturday 31 October 2009 15:53:53 Dimitry Andric wrote:
> On 2009-10-31 14:14, Dimitry Andric wrote:
> > Somewhere between r198312 and r198702 I started getting this message
> > during boot, on a machine using serial console:
> >
> > WARNING: console at 0xc093cea0 has no name
>
> Okay, this seems to be caused by r198655, which is an MFC of r197570,
> where experimental support for USB serial console was added.
>
> However, the consdev::cn_name field is never initialized in
> usb_serial.c, whereas this does happen in other console drivers.
>
> There doesn't seem to be a consensus whether this field needs to be
> initialized in the _cnprobe() or _cninit() functions: I count 9 instances
> of initialization in the former, and 3 in the latter.  Is there a
> preferred way?
>
> Since _cnprobe seems more popular, I propose the following fix:
>
> Index: sys/dev/usb/serial/usb_serial.c
> ===================================================================
> --- sys/dev/usb/serial/usb_serial.c	(revision 198702)
> +++ sys/dev/usb/serial/usb_serial.c	(working copy)
> @@ -1301,6 +1301,7 @@ static void
>  ucom_cnprobe(struct consdev  *cp)
>  {
>  	cp->cn_pri = CN_NORMAL;
> +	strlcpy(cp->cn_name, "ucom", sizeof cp->cn_name);
>  }
>
>  static void

Patch looks fine by me.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200910311643.36862.hselasky>