Re: [Alsa-devel] [PATCH] alsa: correct nonsensical sysfs device symlinks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Updated version of patch also taking into account feedback from
Takashi is attached.

I'm going to look at hald now.

Monty
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-25 12:31:28.000000000 -0500
@@ -264,8 +264,10 @@ 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),
+		device = card->parent;
+	preg->dev = device_create(sound_class,
+				  device,
+				  MKDEV(major, minor),
 				  "%s", name);
 	if (preg->dev)
 		dev_set_drvdata(preg->dev, private_data);
diff -uprN -X linux-2.6.20-rc5/Documentation/dontdiff linux-2.6.20-rc5/sound/sound_core.c linux-2.6.20-rc5-monty/sound/sound_core.c
--- linux-2.6.20-rc5/sound/sound_core.c	2007-01-12 13:54:26.000000000 -0500
+++ linux-2.6.20-rc5-monty/sound/sound_core.c	2007-01-25 12:04:30.000000000 -0500
@@ -170,7 +170,8 @@ static int sound_insert_unit(struct soun
 	else
 		sprintf(s->name, "sound/%s%d", name, r / SOUND_STEP);
 
-	device_create(sound_class, dev, MKDEV(SOUND_MAJOR, s->unit_minor),
+	device_create(sound_class, (dev?dev->parent:NULL), 
+		      MKDEV(SOUND_MAJOR, s->unit_minor),
 		      s->name+6);
 	return r;
 

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux