diff options
Diffstat (limited to 'sound/drivers/opl3/opl3_lib.c')
-rw-r--r-- | sound/drivers/opl3/opl3_lib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index a2b9ce06029..ebe4359047c 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -327,6 +327,7 @@ static int snd_opl3_free(struct snd_opl3 *opl3) snd_assert(opl3 != NULL, return -ENXIO); if (opl3->private_free) opl3->private_free(opl3); + snd_opl3_clear_patches(opl3); release_and_free_resource(opl3->res_l_port); release_and_free_resource(opl3->res_r_port); kfree(opl3); @@ -360,7 +361,6 @@ int snd_opl3_new(struct snd_card *card, opl3->hardware = hardware; spin_lock_init(&opl3->reg_lock); spin_lock_init(&opl3->timer_lock); - mutex_init(&opl3->access_mutex); if ((err = snd_device_new(card, SNDRV_DEV_CODEC, opl3, &ops)) < 0) { snd_opl3_free(opl3); @@ -496,6 +496,7 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3, return err; } hw->private_data = opl3; + hw->exclusive = 1; #ifdef CONFIG_SND_OSSEMUL if (device == 0) { hw->oss_type = SNDRV_OSS_DEVICE_TYPE_DMFM; @@ -521,8 +522,10 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3, /* operators - only ioctl */ hw->ops.open = snd_opl3_open; hw->ops.ioctl = snd_opl3_ioctl; + hw->ops.write = snd_opl3_write; hw->ops.release = snd_opl3_release; + opl3->hwdep = hw; opl3->seq_dev_num = seq_device; #if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) if (snd_seq_device_new(card, seq_device, SNDRV_SEQ_DEV_ID_OPL3, |