]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/drivers/opl3/opl3_synth.c
ALSA: Kill snd_assert() in other places
[linux-2.6-omap-h63xx.git] / sound / drivers / opl3 / opl3_synth.c
index a7bf7a4b1f85877a2459ab3bd02f2e6b8d05cd34..962bb9c8b9c8902b5fd5bcaa111a515b8cc71fe8 100644 (file)
 #include <sound/opl3.h>
 #include <sound/asound_fm.h>
 
+#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
+#define OPL3_SUPPORT_SYNTH
+#endif
+
 /*
  *    There is 18 possible 2 OP voices
  *      (9 in the left and 9 in the right).
@@ -88,7 +92,8 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
        struct snd_opl3 *opl3 = hw->private_data;
        void __user *argp = (void __user *)arg;
 
-       snd_assert(opl3 != NULL, return -EINVAL);
+       if (snd_BUG_ON(!opl3))
+               return -EINVAL;
 
        switch (cmd) {
                /* get information */
@@ -155,9 +160,11 @@ int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
 #endif
                return snd_opl3_set_connection(opl3, (int) arg);
 
+#ifdef OPL3_SUPPORT_SYNTH
        case SNDRV_DM_FM_IOCTL_CLEAR_PATCHES:
                snd_opl3_clear_patches(opl3);
                return 0;
+#endif
 
 #ifdef CONFIG_SND_DEBUG
        default:
@@ -178,6 +185,7 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
        return 0;
 }
 
+#ifdef OPL3_SUPPORT_SYNTH
 /*
  * write the device - load patches
  */
@@ -341,6 +349,7 @@ void snd_opl3_clear_patches(struct snd_opl3 *opl3)
        }
        memset(opl3->patch_table, 0, sizeof(opl3->patch_table));
 }
+#endif /* OPL3_SUPPORT_SYNTH */
 
 /* ------------------------------ */