[alsa-devel] [PATCH] ALSA: snd_usb_caiaq: reparent sound device

Takashi Iwai tiwai at suse.de
Thu Jul 2 11:55:20 CEST 2009


At Thu, 2 Jul 2009 11:43:44 +0200,
Daniel Mack wrote:
> 
> On Thu, Jul 02, 2009 at 11:04:48AM +0200, Takashi Iwai wrote:
> > At Thu,  2 Jul 2009 10:46:35 +0200,
> > Daniel Mack wrote:
> > > 
> > > The sound device instance needs to be a child of the USB interface, not
> > > the USB device. Newer udev versions pay attention to that.
> > > 
> > > Signed-off-by: Daniel Mack <daniel at caiaq.de>
> > > Reported-by: Lennart Poettering <lennart at poettering.net>
> > 
> > Applied now.  Thanks.
> 
> Thanks. The usx2y driver would need something similar as well, but I
> didn't test it since I don't have the hardware to test.
> 
> Cc'ed Karsten Wiese for that.

It's trivial, so I did it now :)
The patch is below.


thanks,

Takashi

---
From 3f5d3465be8f6e04f43d9b6d543fe28d4be07d78 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai at suse.de>
Date: Thu, 2 Jul 2009 11:51:44 +0200
Subject: [PATCH] ALSA: usx2y - reparent sound device

Fix the parent device to be the USB interface, not the USB device.
A similiar commit like 563c2bf59d392357bcc1d99642933cc88c687964.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/usb/usx2y/us122l.c   |    2 +-
 sound/usb/usx2y/usbusx2y.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c
index a5aae9d..fd44946 100644
--- a/sound/usb/usx2y/us122l.c
+++ b/sound/usb/usx2y/us122l.c
@@ -514,7 +514,6 @@ static int usx2y_create_card(struct usb_device *device, struct snd_card **cardp)
 		US122L(card)->chip.dev->bus->busnum,
 		US122L(card)->chip.dev->devnum
 		);
-	snd_card_set_dev(card, &device->dev);
 	*cardp = card;
 	return 0;
 }
@@ -531,6 +530,7 @@ static int us122l_usb_probe(struct usb_interface *intf,
 	if (err < 0)
 		return err;
 
+	snd_card_set_dev(card, &intf->dev);
 	if (!us122l_create_card(card)) {
 		snd_card_free(card);
 		return -EINVAL;
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index 5ce0da2..cb4bb83 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -364,7 +364,6 @@ static int usX2Y_create_card(struct usb_device *device, struct snd_card **cardp)
 		0,//us428(card)->usbmidi.ifnum,
 		usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum
 		);
-	snd_card_set_dev(card, &device->dev);
 	*cardp = card;
 	return 0;
 }
@@ -388,6 +387,7 @@ static int usX2Y_usb_probe(struct usb_device *device,
 	err = usX2Y_create_card(device, &card);
 	if (err < 0)
 		return err;
+	snd_card_set_dev(card, &intf->dev);
 	if ((err = usX2Y_hwdep_new(card, device)) < 0  ||
 	    (err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
-- 
1.6.3.2



More information about the Alsa-devel mailing list