From owner-svn-src-head@FreeBSD.ORG Mon Oct 20 18:37:11 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 599EE106567D; Mon, 20 Oct 2008 18:37:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 474BB8FC1A; Mon, 20 Oct 2008 18:37:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KIbBA6078106; Mon, 20 Oct 2008 18:37:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KIbBr7078105; Mon, 20 Oct 2008 18:37:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200810201837.m9KIbBr7078105@svn.freebsd.org> From: Alexander Motin Date: Mon, 20 Oct 2008 18:37:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184095 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 20 Oct 2008 18:37:11 -0000 Author: mav Date: Mon Oct 20 18:37:10 2008 New Revision: 184095 URL: http://svn.freebsd.org/changeset/base/184095 Log: Make HDA PCM device boot and sndstat messages more alike to PCI device ones. Move codec # out of the device name as it is a device address and not part of device type name. Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Mon Oct 20 18:11:30 2008 (r184094) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Oct 20 18:37:10 2008 (r184095) @@ -7552,6 +7552,21 @@ hdac_detach(device_t dev) return (0); } +static int +hdac_print_child(device_t dev, device_t child) +{ + struct hdac_pcm_devinfo *pdevinfo = + (struct hdac_pcm_devinfo *)device_get_ivars(child); + int retval; + + retval = bus_print_child_header(dev, child); + retval += printf(" at cad %d nid %d", + pdevinfo->devinfo->codec->cad, pdevinfo->devinfo->nid); + retval += bus_print_child_footer(dev, child); + + return (retval); +} + static device_method_t hdac_methods[] = { /* device interface */ DEVMETHOD(device_probe, hdac_probe), @@ -7559,6 +7574,8 @@ static device_method_t hdac_methods[] = DEVMETHOD(device_detach, hdac_detach), DEVMETHOD(device_suspend, hdac_suspend), DEVMETHOD(device_resume, hdac_resume), + /* Bus interface */ + DEVMETHOD(bus_print_child, hdac_print_child), { 0, 0 } }; @@ -7581,8 +7598,7 @@ hdac_pcm_probe(device_t dev) (struct hdac_pcm_devinfo *)device_get_ivars(dev); char buf[128]; - snprintf(buf, sizeof(buf), "HDA codec #%d %s PCM #%d", - pdevinfo->devinfo->codec->cad, + snprintf(buf, sizeof(buf), "HDA %s PCM #%d", hdac_codec_name(pdevinfo->devinfo->codec), pdevinfo->index); device_set_desc_copy(dev, buf); @@ -7673,9 +7689,9 @@ hdac_pcm_attach(device_t dev) if (pdevinfo->rec >= 0) pcm_addchan(dev, PCMDIR_REC, &hdac_channel_class, pdevinfo); - snprintf(status, SND_STATUSLEN, "at %s cad %d %s [%s]", - device_get_nameunit(sc->dev), pdevinfo->devinfo->codec->cad, - PCM_KLDSTRING(snd_hda), HDA_DRV_TEST_REV); + snprintf(status, SND_STATUSLEN, "at cad %d nid %d on %s %s", + pdevinfo->devinfo->codec->cad, pdevinfo->devinfo->nid, + device_get_nameunit(sc->dev), PCM_KLDSTRING(snd_hda)); pcm_setstatus(dev, status); return (0);