All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: alsa-devel@alsa-project.org
Subject: [PATCH 4/5] ALSA: snd_usb_caiaq: give better longname
Date: Sat, 30 May 2009 23:44:24 +0200	[thread overview]
Message-ID: <1243719865-26760-4-git-send-email-daniel@caiaq.de> (raw)
In-Reply-To: <1243719865-26760-3-git-send-email-daniel@caiaq.de>

The serial number is of no interest in the longname, remove it. This
gives space for the usb path information which is more informative.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
---
 sound/usb/caiaq/device.c |   23 +++++------------------
 sound/usb/caiaq/device.h |    1 -
 2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index f8915a5..1970cdc 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -382,7 +382,7 @@ static int create_card(struct usb_device* usb_dev, struct snd_card **cardp)
 
 static int __devinit init_card(struct snd_usb_caiaqdev *dev)
 {
-	char *c;
+	char *c, usbpath[32];
 	struct usb_device *usb_dev = dev->chip.dev;
 	struct snd_card *card = dev->chip.card;
 	int err, len;
@@ -424,14 +424,6 @@ static int __devinit init_card(struct snd_usb_caiaqdev *dev)
 	usb_string(usb_dev, usb_dev->descriptor.iProduct,
 		   dev->product_name, CAIAQ_USB_STR_LEN);
 
-	usb_string(usb_dev, usb_dev->descriptor.iSerialNumber,
-		   dev->serial, CAIAQ_USB_STR_LEN);
-
-	/* terminate serial string at first white space occurence */
-	c = strchr(dev->serial, ' ');
-	if (c)
-		*c = '\0';
-
 	strncpy(card->driver, MODNAME, sizeof(card->driver));
 	strncpy(card->shortname, dev->product_name, sizeof(card->shortname));
 
@@ -441,16 +433,11 @@ static int __devinit init_card(struct snd_usb_caiaqdev *dev)
 		if (*c != ' ')
 			card->id[len++] = *c;
 
-	len = snprintf(card->longname, sizeof(card->longname),
-		       "%s %s (serial %s, ",
-		       dev->vendor_name, dev->product_name, dev->serial);
-
-	if (len < sizeof(card->longname) - 2)
-		len += usb_make_path(usb_dev, card->longname + len,
-				     sizeof(card->longname) - len);
+	usb_make_path(usb_dev, usbpath, sizeof(usbpath));
+	snprintf(card->longname, sizeof(card->longname),
+		       "%s %s (%s)",
+		       dev->vendor_name, dev->product_name, usbpath);
 
-	card->longname[len++] = ')';
-	card->longname[len] = '\0';
 	setup_card(dev);
 	return 0;
 }
diff --git a/sound/usb/caiaq/device.h b/sound/usb/caiaq/device.h
index 4cce1ad..ece7351 100644
--- a/sound/usb/caiaq/device.h
+++ b/sound/usb/caiaq/device.h
@@ -81,7 +81,6 @@ struct snd_usb_caiaqdev {
 
 	char vendor_name[CAIAQ_USB_STR_LEN];
 	char product_name[CAIAQ_USB_STR_LEN];
-	char serial[CAIAQ_USB_STR_LEN];
 
 	int n_streams, n_audio_in, n_audio_out;
 	int streaming, first_packet, output_running;
-- 
1.6.3.1

  reply	other threads:[~2009-05-30 21:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-30 21:44 [PATCH 1/5] ALSA: snd_usb_caiaq: clean whitespaces Daniel Mack
2009-05-30 21:44 ` [PATCH 2/5] ALSA: snd_usb_caiaq: give better shortname Daniel Mack
2009-05-30 21:44   ` [PATCH 3/5] ALSA: snd_usb_caiaq: use strncpy Daniel Mack
2009-05-30 21:44     ` Daniel Mack [this message]
2009-05-30 21:44       ` [PATCH 5/5] ALSA: snd_usb_caiaq: bump version number Daniel Mack
2009-06-01  8:32     ` [PATCH 3/5] ALSA: snd_usb_caiaq: use strncpy Takashi Iwai
2009-06-01  9:23       ` Daniel Mack
2009-06-01 16:55         ` Takashi Iwai
2009-06-01 19:36           ` [PATCH 1/5] ALSA: snd_usb_caiaq: clean whitespaces Daniel Mack
2009-06-01 19:36             ` [PATCH 2/5] ALSA: snd_usb_caiaq: give better shortname Daniel Mack
2009-06-01 19:36               ` [PATCH 3/5] ALSA: snd_usb_caiaq: use strlcpy Daniel Mack
2009-06-01 19:36                 ` [PATCH 4/5] ALSA: snd_usb_caiaq: give better longname Daniel Mack
2009-06-01 19:36                   ` [PATCH 5/5] ALSA: snd_usb_caiaq: bump version number Daniel Mack
2009-06-01 21:09               ` [PATCH 2/5] ALSA: snd_usb_caiaq: give better shortname Jaroslav Kysela
2009-06-01 23:46                 ` Takashi Iwai
2009-06-02  7:29                   ` Daniel Mack
2009-06-02  7:49                     ` Takashi Iwai
2009-06-02  9:31                       ` Daniel Mack
2009-06-02  9:50                         ` Takashi Iwai
2009-06-02  9:55                           ` Daniel Mack
2009-06-02 10:10                           ` [PATCH] ALSA: introduce snd_card_make_id_unique() (was: ALSA: snd_usb_caiaq: give better shortname) Daniel Mack
2009-06-02 10:11                           ` [PATCH 2/5] ALSA: snd_usb_caiaq: give better shortname Jaroslav Kysela
2009-06-02 10:28                             ` Daniel Mack
2009-06-02 10:54                               ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2009-05-30 20:25 [PATCH 1/5] ALSA: snd_usb_caiaq: clean whitespaces Daniel Mack
2009-05-30 20:25 ` [PATCH 2/5] ALSA: snd_usb_caiaq: give better shortname Daniel Mack
2009-05-30 20:25   ` [PATCH 3/5] ALSA: snd_usb_caiaq: use strncpy Daniel Mack
2009-05-30 20:25     ` [PATCH 4/5] ALSA: snd_usb_caiaq: give better longname Daniel Mack
2009-05-30 20:06 [PATCH 1/5] ALSA: snd_usb_caiaq: clean whitespaces Daniel Mack
2009-05-30 20:06 ` [PATCH 2/5] ALSA: snd_usb_caiaq: give better shortname Daniel Mack
2009-05-30 20:06   ` [PATCH 3/5] ALSA: snd_usb_caiaq: use strncpy Daniel Mack
2009-05-30 20:06     ` [PATCH 4/5] ALSA: snd_usb_caiaq: give better longname Daniel Mack

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1243719865-26760-4-git-send-email-daniel@caiaq.de \
    --to=daniel@caiaq.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.