Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030356AbXAYQyv (ORCPT ); Thu, 25 Jan 2007 11:54:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030363AbXAYQyv (ORCPT ); Thu, 25 Jan 2007 11:54:51 -0500 Received: from ns.suse.de ([195.135.220.2]:59793 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030356AbXAYQyu (ORCPT ); Thu, 25 Jan 2007 11:54:50 -0500 Date: Thu, 25 Jan 2007 17:54:48 +0100 Message-ID: From: Takashi Iwai To: "Christopher \"Monty\" Montgomery" Cc: "Pierre Ossman" , fedora-desktop-list@redhat.com, alsa-devel@alsa-project.org, jrb@redhat.com, Greg KH , linux-kernel@vger.kernel.org, mclasen@redhat.com, Lennart Poettering , perex@suse.cz Subject: Re: [Alsa-devel] [PATCH] alsa: correct nonsensical sysfs device symlinks In-Reply-To: <806dafc20701250757n3dcb38b7ma5f8423ab3de9850@mail.gmail.com> References: <806dafc20701241750t53b86babn36831cadc7dfa76c@mail.gmail.com> <20070125042616.GA21813@kroah.com> <806dafc20701250611u9935049ja8f88deb2aac4d40@mail.gmail.com> <45B8C9A3.6060107@drzeus.cx> <806dafc20701250736yc5c3048u14ec98e9b6b92574@mail.gmail.com> <45B8CF7E.2040908@drzeus.cx> <806dafc20701250757n3dcb38b7ma5f8423ab3de9850@mail.gmail.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta27) (fiddleheads) (+CVS-20060704) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2331 Lines: 68 At Thu, 25 Jan 2007 10:57:25 -0500, Christopher "Monty" Montgomery wrote: > > On 1/25/07, Pierre Ossman wrote: > > > There is some option about deprecated sysfs stuff. Perhaps this is the > > cause of your twisted tree. It's off here: > > > > # CONFIG_SYSFS_DEPRECATED is not set > > It is set. It is also set in the default config, so plently of people > are running with a broken sysfs tree. > > I assume we agree that even if that's set, the tree should not be > outright broken like it is (the compatability mode should actually be > compatable, ie, work, right? :-) Given that, is my patch correct? > What was there (plugging the old 'dev' arg into the new call's > 'parent' makes no sense) is clearly wrong. It makes sense because the meaning of card->dev was changed, too. Now it points the "card*" object that is the root of all belonging devices. The former card->dev is stored in card->parent. > And it's clear my pacth is incomplete, as it doesn't correct the > device entries for the other entries. Well, for older systems, we shouldn't have also "card*" objects, too. An untested patch below... Takashi diff -r 64671853e8e2 core/init.c --- a/core/init.c Thu Jan 25 13:15:05 2007 +0100 +++ b/core/init.c Thu Jan 25 17:50:06 2007 +0100 @@ -503,12 +503,14 @@ int snd_card_register(struct snd_card *c int err; snd_assert(card != NULL, return -EINVAL); +#ifndef CONFIG_SYSFS_DEPRECATED if (!card->dev) { card->dev = device_create(sound_class, card->parent, 0, "card%i", card->number); if (IS_ERR(card->dev)) card->dev = NULL; } +#endif if ((err = snd_device_register_all(card)) < 0) return err; mutex_lock(&snd_card_mutex); diff -r 64671853e8e2 core/sound.c --- a/core/sound.c Thu Jan 25 13:15:05 2007 +0100 +++ b/core/sound.c Thu Jan 25 17:50:40 2007 +0100 @@ -241,6 +241,9 @@ int snd_register_device_for_dev(int type int minor; struct snd_minor *preg; + if (!device && !card) + device = card->parent; + snd_assert(name, return -EINVAL); preg = kmalloc(sizeof *preg, GFP_KERNEL); if (preg == NULL) - 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/