aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-01 16:41:07 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-01 16:41:07 -0800
commit4549df891a31b9a05b7d183106c09049b79327be (patch)
treed4dfd0921f0dd0dba2525fd33c0962b26ba5ff1e /sound/core/init.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 (diff)
parentDriver core: show drivers in /sys/module/ (diff)
downloadlinux-dev-4549df891a31b9a05b7d183106c09049b79327be.tar.xz
linux-dev-4549df891a31b9a05b7d183106c09049b79327be.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits) Driver core: show drivers in /sys/module/ Documentation/driver-model/platform.txt update/rewrite Driver core: platform_driver_probe(), can save codespace driver core: Use klist_remove() in device_move() driver core: Introduce device_move(): move a device to a new parent. Driver core: make drivers/base/core.c:setup_parent() static driver core: Introduce device_find_child(). sysfs: sysfs_write_file() writes zero terminated data cpu topology: consider sysfs_create_group return value Driver core: Call platform_notify_remove later ACPI: Change ACPI to use dev_archdata instead of firmware_data Driver core: add dev_archdata to struct device Driver core: convert sound core to use struct device Driver core: change mem class_devices to be real devices Driver core: convert fb code to use struct device Driver core: convert firmware code to use struct device Driver core: convert mmc code to use struct device Driver core: convert ppdev code to use struct device Driver core: convert PPP code to use struct device Driver core: convert cpuid code to use struct device ...
Diffstat (limited to 'sound/core/init.c')
-rw-r--r--sound/core/init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index 3058d626a90a..6152a7554dfd 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -361,6 +361,8 @@ static int snd_card_do_free(struct snd_card *card)
snd_printk(KERN_WARNING "unable to free card info\n");
/* Not fatal error */
}
+ if (card->dev)
+ device_unregister(card->dev);
kfree(card);
return 0;
}
@@ -495,6 +497,12 @@ int snd_card_register(struct snd_card *card)
int err;
snd_assert(card != NULL, return -EINVAL);
+ if (!card->dev) {
+ card->dev = device_create(sound_class, card->parent, 0,
+ "card%i", card->number);
+ if (IS_ERR(card->dev))
+ card->dev = NULL;
+ }
if ((err = snd_device_register_all(card)) < 0)
return err;
mutex_lock(&snd_card_mutex);