Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ALSA] opl3 - Fix compilation without sequencer support

Add proper ifdef's to the patch loading code moved from the old instr
layer so that opl3 driver can be compiled without the sequencer support.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Takashi Iwai and committed by
Linus Torvalds
0ee46c9d 2c020a99

+15 -2
+7 -2
include/sound/opl3.h
··· 370 370 int snd_opl3_open(struct snd_hwdep * hw, struct file *file); 371 371 int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file, 372 372 unsigned int cmd, unsigned long arg); 373 - long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count, 374 - loff_t *offset); 375 373 int snd_opl3_release(struct snd_hwdep * hw, struct file *file); 376 374 377 375 void snd_opl3_reset(struct snd_opl3 * opl3); 378 376 377 + #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 378 + long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count, 379 + loff_t *offset); 379 380 int snd_opl3_load_patch(struct snd_opl3 *opl3, 380 381 int prog, int bank, int type, 381 382 const char *name, ··· 385 384 struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank, 386 385 int create_patch); 387 386 void snd_opl3_clear_patches(struct snd_opl3 *opl3); 387 + #else 388 + #define snd_opl3_write NULL 389 + static inline void snd_opl3_clear_patches(struct snd_opl3 *opl3) {} 390 + #endif 388 391 389 392 #endif /* __SOUND_OPL3_H */
+8
sound/drivers/opl3/opl3_synth.c
··· 22 22 #include <sound/opl3.h> 23 23 #include <sound/asound_fm.h> 24 24 25 + #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 26 + #define OPL3_SUPPORT_SYNTH 27 + #endif 28 + 25 29 /* 26 30 * There is 18 possible 2 OP voices 27 31 * (9 in the left and 9 in the right). ··· 159 155 #endif 160 156 return snd_opl3_set_connection(opl3, (int) arg); 161 157 158 + #ifdef OPL3_SUPPORT_SYNTH 162 159 case SNDRV_DM_FM_IOCTL_CLEAR_PATCHES: 163 160 snd_opl3_clear_patches(opl3); 164 161 return 0; 162 + #endif 165 163 166 164 #ifdef CONFIG_SND_DEBUG 167 165 default: ··· 184 178 return 0; 185 179 } 186 180 181 + #ifdef OPL3_SUPPORT_SYNTH 187 182 /* 188 183 * write the device - load patches 189 184 */ ··· 348 341 } 349 342 memset(opl3->patch_table, 0, sizeof(opl3->patch_table)); 350 343 } 344 + #endif /* OPL3_SUPPORT_SYNTH */ 351 345 352 346 /* ------------------------------ */ 353 347