Skip to contentSkip to conversation

2.6.25-rc2 compile error: 'OPL3_PATCH_HASH_SIZE' undeclared

DISCUSSION George Spelvin 2 participants 3 messages Feb 18, 2008 Sound

lore
Share & tools
lore
#0 lore raw

sound/drivers/opl3/opl3_synth.c:308
sound/drivers/opl3/opl3_synth.c:335

I think it's caused by the fact that I don't have the sequencer enabled. The definition inside include/sound/opl3.h is insdie an #ifdef, but the use is not.

CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_RAWMIDI=y
# CONFIG_SND_SEQUENCER is not set
# CONFIG_SND_MIXER_OSS is not set
# CONFIG_SND_PCM_OSS is not set
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set

#1 lore raw

In case it helps, here's a patch that at least compiles. It still leaves the declarations in the headers, so you might want to reorganize it. I'm not sure if the reference to CONFIG_SND_SEQUENCER_MODULE is actually required; doesn't that imply CONFIG_SND_SEQUENCER?

sound/drivers/opl3/opl3_synth.c +21 -0
index a7bf7a4..2c0a8fd 100644
@@ -178,6 +178,8 @@ int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
 	return 0;
 }
 
+#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
+
 /*
  * write the device - load patches
  */
@@ -341,6 +343,25 @@ void snd_opl3_clear_patches(struct snd_opl3 *opl3)
 	}
 	memset(opl3->patch_table, 0, sizeof(opl3->patch_table));
 }
+#else /* SND_SEQUENCER not configured */
+
+/* Stub functions to avoid #ifdef in opl3_lib.c */
+long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count,
+		    loff_t *offset)
+{
+	(void)hw;
+	(void)buf;
+	(void)count;
+	(void)offset;
+	return -ENXIO;
+}
+void snd_opl3_clear_patches(struct snd_opl3 *opl3)
+{
+	(void)opl3;
+}
+
+#endif
+
 
 /* ------------------------------ */