diff options
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/hwdep.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 195cafc5a553..a70ee7f1ed98 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c | |||
@@ -99,9 +99,6 @@ static int snd_hwdep_open(struct inode *inode, struct file * file) | |||
99 | if (hw == NULL) | 99 | if (hw == NULL) |
100 | return -ENODEV; | 100 | return -ENODEV; |
101 | 101 | ||
102 | if (!hw->ops.open) | ||
103 | return -ENXIO; | ||
104 | |||
105 | if (!try_module_get(hw->card->module)) | 102 | if (!try_module_get(hw->card->module)) |
106 | return -EFAULT; | 103 | return -EFAULT; |
107 | 104 | ||
@@ -113,6 +110,10 @@ static int snd_hwdep_open(struct inode *inode, struct file * file) | |||
113 | err = -EBUSY; | 110 | err = -EBUSY; |
114 | break; | 111 | break; |
115 | } | 112 | } |
113 | if (!hw->ops.open) { | ||
114 | err = 0; | ||
115 | break; | ||
116 | } | ||
116 | err = hw->ops.open(hw, file); | 117 | err = hw->ops.open(hw, file); |
117 | if (err >= 0) | 118 | if (err >= 0) |
118 | break; | 119 | break; |
@@ -151,7 +152,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file) | |||
151 | 152 | ||
152 | static int snd_hwdep_release(struct inode *inode, struct file * file) | 153 | static int snd_hwdep_release(struct inode *inode, struct file * file) |
153 | { | 154 | { |
154 | int err = -ENXIO; | 155 | int err = 0; |
155 | struct snd_hwdep *hw = file->private_data; | 156 | struct snd_hwdep *hw = file->private_data; |
156 | struct module *mod = hw->card->module; | 157 | struct module *mod = hw->card->module; |
157 | 158 | ||