From 3e23c658833f135508127c955d40d7c9387f71dd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 3 Jan 2006 19:54:44 +0100 Subject: [PATCH] [ALSA] Revert the nested-device patch Modules: ALSA Core Revert the nested-device patch to keep the compatibility with the current HAL configuration. Signed-off-by: Takashi Iwai --- include/sound/core.h | 1 - sound/core/device.c | 2 +- sound/core/sound.c | 11 ++--------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/include/sound/core.h b/include/sound/core.h index dbe7a2c30272..90ac6132ea3b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -134,7 +134,6 @@ struct snd_card { wait_queue_head_t shutdown_sleep; struct work_struct free_workq; /* for free in workqueue */ struct device *dev; - struct class_device *parent_device; #ifdef CONFIG_PM unsigned int power_state; /* power state */ diff --git a/sound/core/device.c b/sound/core/device.c index 478264cab67e..b1cf6ec56784 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -193,7 +193,7 @@ int snd_device_register_all(struct snd_card *card) int err; snd_assert(card != NULL, return -ENXIO); - list_for_each_prev(list, &card->devices) { + list_for_each(list, &card->devices) { dev = snd_device(list); if (dev->state == SNDRV_DEV_BUILD && dev->ops->dev_register) { if ((err = dev->ops->dev_register(dev)) < 0) diff --git a/sound/core/sound.c b/sound/core/sound.c index 2f6108deb211..a8eda02bcf1c 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -245,7 +245,6 @@ int snd_register_device(int type, struct snd_card *card, int dev, int minor; struct snd_minor *preg; struct device *device = NULL; - struct class_device *class_device = NULL; snd_assert(name, return -EINVAL); preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL); @@ -273,15 +272,9 @@ int snd_register_device(int type, struct snd_card *card, int dev, snd_minors[minor] = preg; if (type != SNDRV_DEVICE_TYPE_CONTROL || preg->card >= cards_limit) devfs_mk_cdev(MKDEV(major, minor), S_IFCHR | device_mode, "snd/%s", name); - if (card) { + if (card) device = card->dev; - class_device = card->parent_device; - } - class_device = class_device_create(sound_class, class_device, - MKDEV(major, minor), device, - "%s", name); - if (type == SNDRV_DEVICE_TYPE_CONTROL) - card->parent_device = class_device; + class_device_create(sound_class, NULL, MKDEV(major, minor), device, "%s", name); up(&sound_mutex); return 0; -- 2.20.1