From 512bbd6a85230f16389f0dd51925472e72fc8a91 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 13:51:18 +0100 Subject: [ALSA] Remove xxx_t typedefs: Core component Modules: ALSA Core Remove xxx_t typedefs from the core component. Signed-off-by: Takashi Iwai --- sound/core/device.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'sound/core/device.c') diff --git a/sound/core/device.c b/sound/core/device.c index 1f509f56e60c..afa8cc7fb05e 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -41,10 +41,10 @@ * * Returns zero if successful, or a negative error code on failure. */ -int snd_device_new(snd_card_t *card, snd_device_type_t type, - void *device_data, snd_device_ops_t *ops) +int snd_device_new(struct snd_card *card, snd_device_type_t type, + void *device_data, struct snd_device_ops *ops) { - snd_device_t *dev; + struct snd_device *dev; snd_assert(card != NULL, return -ENXIO); snd_assert(device_data != NULL, return -ENXIO); @@ -73,10 +73,10 @@ int snd_device_new(snd_card_t *card, snd_device_type_t type, * Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_free(snd_card_t *card, void *device_data) +int snd_device_free(struct snd_card *card, void *device_data) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; snd_assert(card != NULL, return -ENXIO); snd_assert(device_data != NULL, return -ENXIO); @@ -86,7 +86,8 @@ int snd_device_free(snd_card_t *card, void *device_data) continue; /* unlink */ list_del(&dev->list); - if ((dev->state == SNDRV_DEV_REGISTERED || dev->state == SNDRV_DEV_DISCONNECTED) && + if ((dev->state == SNDRV_DEV_REGISTERED || + dev->state == SNDRV_DEV_DISCONNECTED) && dev->ops->dev_unregister) { if (dev->ops->dev_unregister(dev)) snd_printk(KERN_ERR "device unregister failure\n"); @@ -99,7 +100,8 @@ int snd_device_free(snd_card_t *card, void *device_data) kfree(dev); return 0; } - snd_printd("device free %p (from %p), not found\n", device_data, __builtin_return_address(0)); + snd_printd("device free %p (from %p), not found\n", device_data, + __builtin_return_address(0)); return -ENXIO; } @@ -116,10 +118,10 @@ int snd_device_free(snd_card_t *card, void *device_data) * Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_disconnect(snd_card_t *card, void *device_data) +int snd_device_disconnect(struct snd_card *card, void *device_data) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; snd_assert(card != NULL, return -ENXIO); snd_assert(device_data != NULL, return -ENXIO); @@ -127,14 +129,16 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) dev = snd_device(list); if (dev->device_data != device_data) continue; - if (dev->state == SNDRV_DEV_REGISTERED && dev->ops->dev_disconnect) { + if (dev->state == SNDRV_DEV_REGISTERED && + dev->ops->dev_disconnect) { if (dev->ops->dev_disconnect(dev)) snd_printk(KERN_ERR "device disconnect failure\n"); dev->state = SNDRV_DEV_DISCONNECTED; } return 0; } - snd_printd("device disconnect %p (from %p), not found\n", device_data, __builtin_return_address(0)); + snd_printd("device disconnect %p (from %p), not found\n", device_data, + __builtin_return_address(0)); return -ENXIO; } @@ -151,10 +155,10 @@ int snd_device_disconnect(snd_card_t *card, void *device_data) * Returns zero if successful, or a negative error code on failure or if the * device not found. */ -int snd_device_register(snd_card_t *card, void *device_data) +int snd_device_register(struct snd_card *card, void *device_data) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; int err; snd_assert(card != NULL, return -ENXIO); @@ -179,10 +183,10 @@ int snd_device_register(snd_card_t *card, void *device_data) * register all the devices on the card. * called from init.c */ -int snd_device_register_all(snd_card_t *card) +int snd_device_register_all(struct snd_card *card) { struct list_head *list; - snd_device_t *dev; + struct snd_device *dev; int err; snd_assert(card != NULL, return -ENXIO); @@ -201,9 +205,9 @@ int snd_device_register_all(snd_card_t *card) * disconnect all the devices on the card. * called from init.c */ -int snd_device_disconnect_all(snd_card_t *card) +int snd_device_disconnect_all(struct snd_card *card) { - snd_device_t *dev; + struct snd_device *dev; struct list_head *list; int err = 0; @@ -220,9 +224,9 @@ int snd_device_disconnect_all(snd_card_t *card) * release all the devices on the card. * called from init.c */ -int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd) +int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd) { - snd_device_t *dev; + struct snd_device *dev; struct list_head *list; int err; unsigned int range_low, range_high; -- cgit v1.2.3-59-g8ed1b From 73e77ba0235532bd7523ba90883d325f6e095acf Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 17 Nov 2005 17:44:01 +0100 Subject: [ALSA] Add error messages Add error messages in the critial error path to be more verbose. Signed-off-by: Takashi Iwai --- sound/core/control.c | 8 ++++++-- sound/core/device.c | 5 ++++- sound/core/hwdep.c | 7 ++++--- sound/core/pcm.c | 16 +++++++++++----- sound/core/rawmidi.c | 18 ++++++++++++++---- sound/core/timer.c | 4 +++- sound/drivers/mpu401/mpu401_uart.c | 1 + sound/drivers/opl3/opl3_lib.c | 4 +++- sound/isa/opl3sa2.c | 27 ++++++++++++++++++++------- 9 files changed, 66 insertions(+), 24 deletions(-) (limited to 'sound/core/device.c') diff --git a/sound/core/control.c b/sound/core/control.c index 03ae9bb7d38e..f8f98cc52417 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -195,8 +195,10 @@ struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol *control, unsigned int acce snd_assert(control != NULL, return NULL); snd_assert(control->count > 0, return NULL); kctl = kzalloc(sizeof(*kctl) + sizeof(struct snd_kcontrol_volatile) * control->count, GFP_KERNEL); - if (kctl == NULL) + if (kctl == NULL) { + snd_printk(KERN_ERR "Cannot allocate control instance\n"); return NULL; + } *kctl = *control; for (idx = 0; idx < kctl->count; idx++) kctl->vd[idx].access = access; @@ -309,7 +311,9 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) struct snd_ctl_elem_id id; unsigned int idx; - snd_assert(card != NULL && kcontrol != NULL, return -EINVAL); + snd_assert(card != NULL, return -EINVAL); + if (! kcontrol) + return -EINVAL; snd_assert(kcontrol->info != NULL, return -EINVAL); id = kcontrol->id; down_write(&card->controls_rwsem); diff --git a/sound/core/device.c b/sound/core/device.c index afa8cc7fb05e..b1cf6ec56784 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -50,8 +50,10 @@ int snd_device_new(struct snd_card *card, snd_device_type_t type, snd_assert(device_data != NULL, return -ENXIO); snd_assert(ops != NULL, return -ENXIO); dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (dev == NULL) + if (dev == NULL) { + snd_printk(KERN_ERR "Cannot allocate device\n"); return -ENOMEM; + } dev->card = card; dev->type = type; dev->state = SNDRV_DEV_BUILD; @@ -173,6 +175,7 @@ int snd_device_register(struct snd_card *card, void *device_data) dev->state = SNDRV_DEV_REGISTERED; return 0; } + snd_printd("snd_device_register busy\n"); return -EBUSY; } snd_BUG(); diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index da0fb9f08413..444e266e7c48 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -364,13 +364,14 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device, *rhwdep = NULL; snd_assert(card != NULL, return -ENXIO); hwdep = kzalloc(sizeof(*hwdep), GFP_KERNEL); - if (hwdep == NULL) + if (hwdep == NULL) { + snd_printk(KERN_ERR "hwdep: cannot allocate\n"); return -ENOMEM; + } hwdep->card = card; hwdep->device = device; - if (id) { + if (id) strlcpy(hwdep->id, id, sizeof(hwdep->id)); - } #ifdef CONFIG_SND_OSSEMUL hwdep->oss_type = -1; #endif diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 59c995bbf15b..9305ac357a3e 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -600,14 +600,18 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) pstr->reg = &snd_pcm_reg[stream]; if (substream_count > 0) { err = snd_pcm_stream_proc_init(pstr); - if (err < 0) + if (err < 0) { + snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n"); return err; + } } prev = NULL; for (idx = 0, prev = NULL; idx < substream_count; idx++) { substream = kzalloc(sizeof(*substream), GFP_KERNEL); - if (substream == NULL) + if (substream == NULL) { + snd_printk(KERN_ERR "Cannot allocate PCM substream\n"); return -ENOMEM; + } substream->pcm = pcm; substream->pstr = pstr; substream->number = idx; @@ -620,6 +624,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) prev->next = substream; err = snd_pcm_substream_proc_init(substream); if (err < 0) { + snd_printk(KERN_ERR "Error in snd_pcm_stream_proc_init\n"); kfree(substream); return err; } @@ -666,13 +671,14 @@ int snd_pcm_new(struct snd_card *card, char *id, int device, *rpcm = NULL; snd_assert(card != NULL, return -ENXIO); pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); - if (pcm == NULL) + if (pcm == NULL) { + snd_printk(KERN_ERR "Cannot allocate PCM\n"); return -ENOMEM; + } pcm->card = card; pcm->device = device; - if (id) { + if (id) strlcpy(pcm->id, id, sizeof(pcm->id)); - } if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) { snd_pcm_free(pcm); return err; diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index ede0a6083d29..7a86a9a08a15 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -1382,8 +1382,10 @@ static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi, INIT_LIST_HEAD(&stream->substreams); for (idx = 0; idx < count; idx++) { substream = kzalloc(sizeof(*substream), GFP_KERNEL); - if (substream == NULL) + if (substream == NULL) { + snd_printk(KERN_ERR "rawmidi: cannot allocate substream\n"); return -ENOMEM; + } substream->stream = direction; substream->number = idx; substream->rmidi = rmidi; @@ -1425,19 +1427,27 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, *rrawmidi = NULL; snd_assert(card != NULL, return -ENXIO); rmidi = kzalloc(sizeof(*rmidi), GFP_KERNEL); - if (rmidi == NULL) + if (rmidi == NULL) { + snd_printk(KERN_ERR "rawmidi: cannot allocate\n"); return -ENOMEM; + } rmidi->card = card; rmidi->device = device; init_MUTEX(&rmidi->open_mutex); init_waitqueue_head(&rmidi->open_wait); if (id != NULL) strlcpy(rmidi->id, id, sizeof(rmidi->id)); - if ((err = snd_rawmidi_alloc_substreams(rmidi, &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT], SNDRV_RAWMIDI_STREAM_INPUT, input_count)) < 0) { + if ((err = snd_rawmidi_alloc_substreams(rmidi, + &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT], + SNDRV_RAWMIDI_STREAM_INPUT, + input_count)) < 0) { snd_rawmidi_free(rmidi); return err; } - if ((err = snd_rawmidi_alloc_substreams(rmidi, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT], SNDRV_RAWMIDI_STREAM_OUTPUT, output_count)) < 0) { + if ((err = snd_rawmidi_alloc_substreams(rmidi, + &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT], + SNDRV_RAWMIDI_STREAM_OUTPUT, + output_count)) < 0) { snd_rawmidi_free(rmidi); return err; } diff --git a/sound/core/timer.c b/sound/core/timer.c index 18d43a037850..74637cef6d2c 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -777,8 +777,10 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, snd_assert(rtimer != NULL, return -EINVAL); *rtimer = NULL; timer = kzalloc(sizeof(*timer), GFP_KERNEL); - if (timer == NULL) + if (timer == NULL) { + snd_printk(KERN_ERR "timer: cannot allocate\n"); return -ENOMEM; + } timer->tmr_class = tid->dev_class; timer->card = card; timer->tmr_device = tid->device; diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c index 16e87f31788c..ee67b522d259 100644 --- a/sound/drivers/mpu401/mpu401_uart.c +++ b/sound/drivers/mpu401/mpu401_uart.c @@ -462,6 +462,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device, return err; mpu = kzalloc(sizeof(*mpu), GFP_KERNEL); if (mpu == NULL) { + snd_printk(KERN_ERR "mpu401_uart: cannot allocate\n"); snd_device_free(card, rmidi); return -ENOMEM; } diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index cbd37e919601..650f3b8e60e0 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -349,8 +349,10 @@ int snd_opl3_new(struct snd_card *card, *ropl3 = NULL; opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL); - if (opl3 == NULL) + if (opl3 == NULL) { + snd_printk(KERN_ERR "opl3: cannot allocate\n"); return -ENOMEM; + } opl3->card = card; opl3->hardware = hardware; diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index b923de9b321d..aafe5565b6e5 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -496,21 +496,29 @@ static int __init snd_opl3sa2_mixer(struct snd_opl3sa2 *chip) /* reassign AUX0 to CD */ strcpy(id1.name, "Aux Playback Switch"); strcpy(id2.name, "CD Playback Switch"); - if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) + if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { + snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); return err; + } strcpy(id1.name, "Aux Playback Volume"); strcpy(id2.name, "CD Playback Volume"); - if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) + if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { + snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); return err; + } /* reassign AUX1 to FM */ strcpy(id1.name, "Aux Playback Switch"); id1.index = 1; strcpy(id2.name, "FM Playback Switch"); - if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) + if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { + snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); return err; + } strcpy(id1.name, "Aux Playback Volume"); strcpy(id2.name, "FM Playback Volume"); - if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) + if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { + snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); return err; + } /* add OPL3SA2 controls */ for (idx = 0; idx < ARRAY_SIZE(snd_opl3sa2_controls); idx++) { if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_opl3sa2_controls[idx], chip))) < 0) @@ -575,8 +583,10 @@ static int __init snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip, int err; cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); - if (!cfg) + if (!cfg) { + snd_printk(KERN_ERR PFX "cannot allocate pnp cfg\n"); return -ENOMEM; + } /* PnP initialization */ pnp_init_resource_table(cfg); if (sb_port[dev] != SNDRV_AUTO_PORT) @@ -597,7 +607,7 @@ static int __init snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip, pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); err = pnp_manual_config_dev(pdev, cfg, 0); if (err < 0) - snd_printk(KERN_ERR "PnP manual resources are invalid, using auto config\n"); + snd_printk(KERN_WARNING "PnP manual resources are invalid, using auto config\n"); err = pnp_activate_dev(pdev); if (err < 0) { kfree(cfg); @@ -784,8 +794,11 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, struct snd_card *card; pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL); - if (pdev == NULL) + if (pdev == NULL) { + snd_printk(KERN_ERR PFX "can't get pnp device from id '%s'\n", + id->devs[0].id); return -EBUSY; + } for (; dev < SNDRV_CARDS; dev++) { if (enable[dev] && isapnp[dev]) break; -- cgit v1.2.3-59-g8ed1b From 416c1079d30f1a52399b96f6772e993274b774ae Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 7 Dec 2005 09:11:05 +0100 Subject: [ALSA] Nest sound devices Modules: ALSA Core Make the control device parent of all other ALSA devices of a card. Signed-off-by: Clemens Ladisch --- include/sound/core.h | 1 + sound/core/device.c | 2 +- sound/core/sound.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'sound/core/device.c') diff --git a/include/sound/core.h b/include/sound/core.h index 90ac6132ea3b..dbe7a2c30272 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -134,6 +134,7 @@ 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 b1cf6ec56784..478264cab67e 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(list, &card->devices) { + list_for_each_prev(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 a8eda02bcf1c..2f6108deb211 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c @@ -245,6 +245,7 @@ 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); @@ -272,9 +273,15 @@ 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_create(sound_class, NULL, MKDEV(major, minor), device, "%s", name); + 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; up(&sound_mutex); return 0; -- cgit v1.2.3-59-g8ed1b From 3e23c658833f135508127c955d40d7c9387f71dd Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 3 Jan 2006 19:54:44 +0100 Subject: [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(-) (limited to 'sound/core/device.c') 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; -- cgit v1.2.3-59-g8ed1b