summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-24 02:35:41 +0300
committerTakashi Iwai <tiwai@suse.de>2009-03-24 02:35:41 +0300
commitc2f43981e5dbc92884149aa2234064cc2c340acd (patch)
treebd5273bc7ae92a1ef47fa3f35ec6ef79d28ba270 /sound/core
parentdec14f8c0eff54549e5747f8a4d1dc6c0347e2dd (diff)
parent28b7e343ee63454d563a71d2d5f769fc297fd5ad (diff)
downloadlinux-c2f43981e5dbc92884149aa2234064cc2c340acd.tar.xz
Merge branch 'topic/hwdep-cleanup' into for-linus
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/hwdep.c9
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)
if (hw == NULL)
return -ENODEV;
- if (!hw->ops.open)
- return -ENXIO;
-
if (!try_module_get(hw->card->module))
return -EFAULT;
@@ -113,6 +110,10 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
err = -EBUSY;
break;
}
+ if (!hw->ops.open) {
+ err = 0;
+ break;
+ }
err = hw->ops.open(hw, file);
if (err >= 0)
break;
@@ -151,7 +152,7 @@ static int snd_hwdep_open(struct inode *inode, struct file * file)
static int snd_hwdep_release(struct inode *inode, struct file * file)
{
- int err = -ENXIO;
+ int err = 0;
struct snd_hwdep *hw = file->private_data;
struct module *mod = hw->card->module;