Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161190AbWJKWxB (ORCPT ); Wed, 11 Oct 2006 18:53:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161201AbWJKWxB (ORCPT ); Wed, 11 Oct 2006 18:53:01 -0400 Received: from mail.kroah.org ([69.55.234.183]:44489 "EHLO perch.kroah.org") by vger.kernel.org with ESMTP id S1161190AbWJKWxA (ORCPT ); Wed, 11 Oct 2006 18:53:00 -0400 Date: Wed, 11 Oct 2006 15:52:31 -0700 From: Greg KH To: Jaroslav Kysela Cc: Kay Sievers , LKML , Takashi Iwai Subject: Re: sysfs & ALSA card Message-ID: <20061011225231.GA30151@kroah.com> References: <20061007062458.GF23366@kroah.com> <20061007074440.GA9304@kroah.com> <1160225730.19302.1.camel@localhost> <20061007191228.GA31396@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2540 Lines: 73 On Mon, Oct 09, 2006 at 08:24:55AM +0200, Jaroslav Kysela wrote: > On Sat, 7 Oct 2006, Kay Sievers wrote: > > > On Sat, Oct 07, 2006 at 02:55:31PM +0200, Kay Sievers wrote: > > > On Sat, 2006-10-07 at 00:44 -0700, Greg KH wrote: > > > > $ tree /sys/class/sound/ > > > > /sys/class/sound/ > > > > |-- Audigy2 -> ../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.0/Audigy2 > > > > |-- admmidi1 -> ../../devices/pci0000:00/0000:00:1e.0/0000:06:0d.0/Audigy2/admmidi1 > > > > > > Yeah, I picked the wrong name for the card, it should be "card1" instead > > > > of "Audigy2" here, but you get the idea. > > > > > > That looks nice. Yeah, it should something that matches to the C1 in the > > > other names. > > > > This works fine for me with two soundcards and connect/disconnect > > module load/unload. > > > > All devices are in a flat list in the class directory, also the card%i > > ones: > > $ tree /sys/class/sound/ > > /sys/class/sound/ > > |-- adsp -> ../../devices/pci0000:00/0000:00:1e.2/card0/adsp > > .... > > > In the /sys/devices hierarchy all devices belonging to the same card are > > nicely below the card device: > > $ ls -l /sys/devices/pci0000:00/0000:00:1e.2/card0 > > total 0 > > drwxr-xr-x 3 root root 0 2006-10-07 21:09 0-0:AD1981B > > drwxr-xr-x 3 root root 0 2006-10-07 21:09 adsp > > drwxr-xr-x 3 root root 0 2006-10-07 21:09 audio > > .... > > The implementation looks good (Acked-by: Jaroslav Kysela ). > Please, fix this small typo: > > > --- linux-2.6.orig/sound/core/sound.c > > +++ linux-2.6/sound/core/sound.c > > @@ -268,11 +268,10 @@ int snd_register_device(int type, struct > > snd_minors[minor] = preg; > > if (card) > > device = card->dev; > > - preg->class_dev = class_device_create(sound_class, NULL, > > - MKDEV(major, minor), > > - device, "%s", name); > > - if (preg->class_dev) > > - class_set_devdata(preg->class_dev, private_data); > > + preg->dev = device_create(sound_class, device, MKDEV(major, minor), > > + "%s", name); > > + if (preg->dev) > > + dev_get_drvdata(preg->dev); > > I think, it should be: > > if (preg->dev) > dev_set_drvdata(preg->dev, private_data); Ick, you are correct, sorry about that. I've fixed it now in my tree. thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/