diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-09-24 01:52:47 -0400 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-09-24 01:52:47 -0400 |
| commit | 23930fa1cebfea6f79881c588ccd1b0781e49e3f (patch) | |
| tree | 36d29e3f83661c4f5f45b6f74ac0d5f9886867a8 /sound/core/device.c | |
| parent | 36b35a5be0e4b406acd816e2122d153e875105be (diff) | |
| parent | 4f5537de7c1531398e84e18a24f667e49cc94208 (diff) | |
Merge branch 'master' into upstream
Diffstat (limited to 'sound/core/device.c')
| -rw-r--r-- | sound/core/device.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/core/device.c b/sound/core/device.c index 6ce4da4a108..ccb25816ac9 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -71,7 +71,7 @@ EXPORT_SYMBOL(snd_device_new); * @device_data: the data pointer to release * * Removes the device from the list on the card and invokes the - * callback, dev_unregister or dev_free, corresponding to the state. + * callbacks, dev_disconnect and dev_free, corresponding to the state. * Then release the device. * * Returns zero if successful, or a negative error code on failure or if the @@ -90,16 +90,14 @@ int snd_device_free(struct snd_card *card, void *device_data) continue; /* unlink */ list_del(&dev->list); - 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"); - } else { - if (dev->ops->dev_free) { - if (dev->ops->dev_free(dev)) - snd_printk(KERN_ERR "device free failure\n"); - } + if (dev->state == SNDRV_DEV_REGISTERED && + dev->ops->dev_disconnect) + if (dev->ops->dev_disconnect(dev)) + snd_printk(KERN_ERR + "device disconnect failure\n"); + if (dev->ops->dev_free) { + if (dev->ops->dev_free(dev)) + snd_printk(KERN_ERR "device free failure\n"); } kfree(dev); return 0; |
