public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] alsa: correct nonsensical sysfs device symlinks
@ 2007-01-25  1:50 Christopher "Monty" Montgomery
  2007-01-25  4:26 ` Greg KH
  2007-01-25 11:27 ` Pierre Ossman
  0 siblings, 2 replies; 30+ messages in thread
From: Christopher "Monty" Montgomery @ 2007-01-25  1:50 UTC (permalink / raw)
  To: perex, greg, mclasen, jrb, Lennart Poettering, Pierre Ossman
  Cc: linux-kernel, alsa-devel, fedora-desktop-list

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

This patch was generated against 2.6.20-rc5; it fixes a bug that
cropped up in a late 2.6.19-mm kernel.

When ALSA's sysfs device creation was converted from using
class_device_create() to device_create(), the fourth param from
class_device_create() [dev] was simply plugged into arg 2 of
device_create().  This causes the device symlinks under all the
class/sound/[node] to point to nonsensical places.  Among other
problems, this breaks HAL and all audio software that depends on HAL.

The nature of this bug is not simply a need to update HAL;
class/[node]/device symlinks are required to point to a device entry
in /sys/devices; the bug causes them to point to other places within
/sys/class.  This patch is [hopefully] a trivial change to restore the
desired behavior.

Signed-off-by: Monty Montgomery <xiphmont@gmail.com>
---

Apologies for sending patch as text/plain attachment; we've
established in the past that Gmail will not leave unformatted text
email unmunged.

[-- Attachment #2: alsa-sysfs-fix-2.6.20-rc5.txt --]
[-- Type: text/plain, Size: 674 bytes --]

diff -uprN -X linux-2.6.20-rc5/Documentation/dontdiff linux-2.6.20-rc5/sound/core/sound.c linux-2.6.20-rc5-monty/sound/core/sound.c
--- linux-2.6.20-rc5/sound/core/sound.c	2007-01-12 13:54:26.000000000 -0500
+++ linux-2.6.20-rc5-monty/sound/core/sound.c	2007-01-24 20:30:07.000000000 -0500
@@ -265,7 +265,9 @@ int snd_register_device(int type, struct
 	snd_minors[minor] = preg;
 	if (card)
 		device = card->dev;
-	preg->dev = device_create(sound_class, device, MKDEV(major, minor),
+	preg->dev = device_create(sound_class, 
+				  (device?device->parent:NULL), 
+				  MKDEV(major, minor),
 				  "%s", name);
 	if (preg->dev)
 		dev_set_drvdata(preg->dev, private_data);

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2007-01-26 21:58 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-25  1:50 [PATCH] alsa: correct nonsensical sysfs device symlinks Christopher "Monty" Montgomery
2007-01-25  4:26 ` Greg KH
2007-01-25 14:11   ` Christopher "Monty" Montgomery
2007-01-25 15:15     ` Pierre Ossman
2007-01-25 15:36       ` Christopher "Monty" Montgomery
2007-01-25 15:40         ` Pierre Ossman
2007-01-25 15:57           ` Christopher "Monty" Montgomery
2007-01-25 16:54             ` [Alsa-devel] " Takashi Iwai
2007-01-25 17:03               ` Christopher "Monty" Montgomery
2007-01-25 17:30                 ` xiphmont
2007-01-25 17:47                   ` Takashi Iwai
2007-01-25 18:07                     ` xiphmont
2007-01-25 18:23                       ` Takashi Iwai
2007-01-25 18:34                         ` xiphmont
2007-01-25 18:38                           ` Takashi Iwai
2007-01-25 18:51                             ` xiphmont
2007-01-25 19:49                               ` Greg KH
2007-01-25 20:40                                 ` xiphmont
2007-01-25 21:59                                   ` Greg KH
2007-01-26 10:53                                     ` xiphmont
2007-01-26 11:40                                       ` Takashi Iwai
2007-01-26 18:04                                         ` Greg KH
2007-01-26 18:25                                           ` Takashi Iwai
2007-01-26 18:31                                             ` xiphmont
2007-01-26 19:06                                             ` Greg KH
2007-01-26 21:58                                               ` xiphmont
2007-01-26 18:03                                     ` xiphmont
2007-01-26 18:42                                       ` Greg KH
2007-01-25 17:48                   ` Christopher "Monty" Montgomery
2007-01-25 11:27 ` Pierre Ossman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox