public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: torvalds@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH 01/16] [ALSA] opl3 - Fix compilation without sequencer support
Date: Fri, 22 Feb 2008 18:34:06 +0100	[thread overview]
Message-ID: <s5hlk5cyjxt.wl%tiwai@suse.de> (raw)
In-Reply-To: <s5hoda8yjza.wl%tiwai@suse.de>

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>
---
 include/sound/opl3.h            |    9 +++++++--
 sound/drivers/opl3/opl3_synth.c |    8 ++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/include/sound/opl3.h b/include/sound/opl3.h
index a0c5feb..6ba6707 100644
--- a/include/sound/opl3.h
+++ b/include/sound/opl3.h
@@ -370,12 +370,13 @@ int snd_opl3_hwdep_new(struct snd_opl3 * opl3, int device, int seq_device,
 int snd_opl3_open(struct snd_hwdep * hw, struct file *file);
 int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
 		   unsigned int cmd, unsigned long arg);
-long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count,
-		    loff_t *offset);
 int snd_opl3_release(struct snd_hwdep * hw, struct file *file);
 
 void snd_opl3_reset(struct snd_opl3 * opl3);
 
+#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
+long snd_opl3_write(struct snd_hwdep *hw, const char __user *buf, long count,
+		    loff_t *offset);
 int snd_opl3_load_patch(struct snd_opl3 *opl3,
 			int prog, int bank, int type,
 			const char *name,
@@ -384,5 +385,9 @@ int snd_opl3_load_patch(struct snd_opl3 *opl3,
 struct fm_patch *snd_opl3_find_patch(struct snd_opl3 *opl3, int prog, int bank,
 				     int create_patch);
 void snd_opl3_clear_patches(struct snd_opl3 *opl3);
+#else
+#define snd_opl3_write	NULL
+static inline void snd_opl3_clear_patches(struct snd_opl3 *opl3) {}
+#endif
 
 #endif /* __SOUND_OPL3_H */
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index a7bf7a4..fb64c89 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -22,6 +22,10 @@
 #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).
@@ -155,9 +159,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 +184,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 +348,7 @@ void snd_opl3_clear_patches(struct snd_opl3 *opl3)
 	}
 	memset(opl3->patch_table, 0, sizeof(opl3->patch_table));
 }
+#endif /* OPL3_SUPPORT_SYNTH */
 
 /* ------------------------------ */
 
-- 
1.5.3.8


  reply	other threads:[~2008-02-22 17:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 17:33 [PATCH 0/16] ALSA fixes for 2.6.25-rc2 Takashi Iwai
2008-02-22 17:34 ` Takashi Iwai [this message]
2008-02-22 17:34 ` [PATCH 02/16] [ALSA] race between disconnect and error handling in usbmidi Takashi Iwai
2008-02-22 17:35 ` [PATCH 03/16] [ALSA] oxygen - Fix section mismatch Takashi Iwai
2008-02-22 17:35 ` [PATCH 04/16] [ALSA] hdsp " Takashi Iwai
2008-02-22 17:36 ` [PATCH 05/16] [ALSA] HDA - enable snoop on SCH Takashi Iwai
2008-02-22 17:36 ` [PATCH 06/16] [ALSA] hda-codec - Fix SPDIF output on Conexant 5045 codec Takashi Iwai
2008-02-22 17:40 ` [PATCH 07/16] [ALSA] oxygen: fix line-in recording selection Takashi Iwai
2008-02-22 17:41 ` [PATCH 08/16] [ALSA] soc - duplicate strcasecmp test for "rj-master" in mpc8610_hpcd_probe() Takashi Iwai
2008-02-22 17:43 ` [PATCH 09/16] [ALSA] hda-codec - Fix race condition in generic bound volume/swtich controls Takashi Iwai
2008-02-22 17:43 ` [PATCH 10/16] [ALSA] hda-codec - Don't create vmaster if no slaves found Takashi Iwai
2008-02-22 17:44 ` [PATCH 11/16] [ALSA] hda-codec - Fix wrong capture source selection for ALC883 codec Takashi Iwai
2008-02-22 17:45 ` [PATCH 12/16] [ALSA] hda-codec - Fix ALC882 capture source selection Takashi Iwai
2008-02-22 17:46 ` [PATCH 13/16] [ALSA] hda-codec - Fix amp-in values for pin widgets Takashi Iwai
2008-02-22 17:46 ` [PATCH 14/16] [ALSA] caiaq - fix section mismatch warning Takashi Iwai
2008-02-22 18:31   ` Sam Ravnborg
2008-02-23 10:23     ` Takashi Iwai
2008-02-22 17:47 ` [PATCH 15/16] [ALSA] hda-intel - Fix Oops with ATI HDMI devices Takashi Iwai
2008-02-22 17:47 ` [PATCH 16/16] [ALSA] bt87X: fix freeing of shared interrupt Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hlk5cyjxt.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox