]> git.hungrycats.org Git - linux/commitdiff
ALSA CVS update
authorJaroslav Kysela <perex@suse.cz>
Thu, 25 Sep 2003 17:16:25 +0000 (19:16 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 25 Sep 2003 17:16:25 +0000 (19:16 +0200)
D:2003/09/04 19:12:30
C:HWDEP Midlevel
A:Jaroslav Kysela <perex@suse.cz>
F:core/hwdep.c:1.18->1.19
L:Karsten Wiese <annabellesgarden@yahoo.de>
L:Fixed hwdep hotplug problem

sound/core/hwdep.c

index 2da3e59258e767708c0f4692b445b53d4f774aee..3e94857d1a7e6cb09f95beb03891adf9f420c9a6 100644 (file)
@@ -133,8 +133,11 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
        set_current_state(TASK_RUNNING);
        remove_wait_queue(&hw->open_wait, &wait);
        if (err >= 0) {
-               file->private_data = hw;
-               hw->used++;
+               err = snd_card_file_add(hw->card, file);
+               if (err >= 0) {
+                       file->private_data = hw;
+                       hw->used++;
+               }
        }
        up(&hw->open_mutex);
        return err;
@@ -151,6 +154,7 @@ static int snd_hwdep_release(struct inode *inode, struct file * file)
        }
        if (hw->used > 0)
                hw->used--;
+       snd_card_file_remove(hw->card, file);
        up(&hw->open_mutex);
        return -ENXIO;  
 }