Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Jul 2012 20:25:50 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r238022 - head/sys/dev/sound/pci/hda
Message-ID:  <201207022025.q62KPotw096918@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Jul  2 20:25:50 2012
New Revision: 238022
URL: http://svn.freebsd.org/changeset/base/238022

Log:
  Remove 14 not very useful characters " HDA CODEC PCM" from HDA pcm device
  names to shorten them. PulseAudio reported to have problems with names
  longer then 63 chars and at least in XMMS long names are inconvinient.
  
  Reported by:	hselasky
  MFC after:	3 days

Modified:
  head/sys/dev/sound/pci/hda/hdaa.c

Modified: head/sys/dev/sound/pci/hda/hdaa.c
==============================================================================
--- head/sys/dev/sound/pci/hda/hdaa.c	Mon Jul  2 20:24:01 2012	(r238021)
+++ head/sys/dev/sound/pci/hda/hdaa.c	Mon Jul  2 20:25:50 2012	(r238022)
@@ -6203,12 +6203,14 @@ hdaa_resume(device_t dev)
 static int
 hdaa_probe(device_t dev)
 {
+	const char *pdesc;
 	char buf[128];
 
 	if (hda_get_node_type(dev) != HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO)
 		return (ENXIO);
-	snprintf(buf, sizeof(buf), "%s Audio Function Group",
-	    device_get_desc(device_get_parent(dev)));
+	pdesc = device_get_desc(device_get_parent(dev));
+	snprintf(buf, sizeof(buf), "%.*s Audio Function Group",
+	    (int)(strlen(pdesc) - 10), pdesc);
 	device_set_desc_copy(dev, buf);
 	return (BUS_PROBE_DEFAULT);
 }
@@ -6565,6 +6567,7 @@ hdaa_pcm_probe(device_t dev)
 	struct hdaa_pcm_devinfo *pdevinfo =
 	    (struct hdaa_pcm_devinfo *)device_get_ivars(dev);
 	struct hdaa_devinfo *devinfo = pdevinfo->devinfo;
+	const char *pdesc;
 	char chans1[8], chans2[8];
 	char buf[128];
 	int loc1, loc2, t1, t2;
@@ -6610,8 +6613,9 @@ hdaa_pcm_probe(device_t dev)
 		t1 = -2;
 	if (pdevinfo->digital)
 		t1 = -2;
-	snprintf(buf, sizeof(buf), "%s PCM (%s%s%s%s%s%s%s%s%s)",
-	    device_get_desc(device_get_parent(device_get_parent(dev))),
+	pdesc = device_get_desc(device_get_parent(dev));
+	snprintf(buf, sizeof(buf), "%.*s (%s%s%s%s%s%s%s%s%s)",
+	    (int)(strlen(pdesc) - 21), pdesc,
 	    loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "",
 	    (pdevinfo->digital == 0x7)?"HDMI/DP":
 	    ((pdevinfo->digital == 0x5)?"DisplayPort":



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