diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h
index c6970aa..b2d6b2a 100644
--- a/include/sound/emux_synth.h
+++ b/include/sound/emux_synth.h
@@ -36,39 +36,40 @@
  */
 #define SNDRV_EMUX_USE_RAW_EFFECT
 
-
-/*
- * typedefs
- */
-typedef struct snd_emux_effect_table snd_emux_effect_table_t;
-typedef struct snd_emux_port snd_emux_port_t;
-typedef struct snd_emux_voice snd_emux_voice_t;
-typedef struct snd_emux snd_emux_t;
-
+struct snd_emux;
+struct snd_emux_port;
+struct snd_emux_voice;
+struct snd_emux_effect_table;
 
 /*
  * operators
  */
-typedef struct snd_emux_operators {
+struct snd_emux_operators {
 	struct module *owner;
-	snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port);
-	int (*prepare)(snd_emux_voice_t *vp);
-	void (*trigger)(snd_emux_voice_t *vp);
-	void (*release)(snd_emux_voice_t *vp);
-	void (*update)(snd_emux_voice_t *vp, int update);
-	void (*terminate)(snd_emux_voice_t *vp);
-	void (*free_voice)(snd_emux_voice_t *vp);
-	void (*reset)(snd_emux_t *emu, int ch);
-	/* the first parameters are snd_emux_t */
-	int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count);
-	int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr);
-	void (*sample_reset)(snd_emux_t *emu);
-	int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count);
-	void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset);
+	struct snd_emux_voice *(*get_voice)(struct snd_emux *emu,
+					    struct snd_emux_port *port);
+	int (*prepare)(struct snd_emux_voice *vp);
+	void (*trigger)(struct snd_emux_voice *vp);
+	void (*release)(struct snd_emux_voice *vp);
+	void (*update)(struct snd_emux_voice *vp, int update);
+	void (*terminate)(struct snd_emux_voice *vp);
+	void (*free_voice)(struct snd_emux_voice *vp);
+	void (*reset)(struct snd_emux *emu, int ch);
+	/* the first parameters are struct snd_emux */
+	int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp,
+			  struct snd_util_memhdr *hdr,
+			  const void __user *data, long count);
+	int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp,
+			   struct snd_util_memhdr *hdr);
+	void (*sample_reset)(struct snd_emux *emu);
+	int (*load_fx)(struct snd_emux *emu, int type, int arg,
+		       const void __user *data, long count);
+	void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
+		      struct snd_midi_channel_set *chset);
 #ifdef CONFIG_SND_SEQUENCER_OSS
-	int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2);
+	int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
 #endif
-} snd_emux_operators_t;
+};
 
 
 /*
@@ -90,46 +91,46 @@
  */
 struct snd_emux {
 
-	snd_card_t *card;	/* assigned card */
+	struct snd_card *card;	/* assigned card */
 
 	/* following should be initialized before registration */
 	int max_voices;		/* Number of voices */
 	int mem_size;		/* memory size (in byte) */
 	int num_ports;		/* number of ports to be created */
 	int pitch_shift;	/* pitch shift value (for Emu10k1) */
-	snd_emux_operators_t ops;	/* operators */
+	struct snd_emux_operators ops;	/* operators */
 	void *hw;		/* hardware */
 	unsigned long flags;	/* other conditions */
 	int midi_ports;		/* number of virtual midi devices */
 	int midi_devidx;	/* device offset of virtual midi */
 	unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */
 	int hwdep_idx;		/* hwdep device index */
-	snd_hwdep_t *hwdep;	/* hwdep device */
+	struct snd_hwdep *hwdep;	/* hwdep device */
 
 	/* private */
 	int num_voices;		/* current number of voices */
-	snd_sf_list_t *sflist;	/* root of SoundFont list */
-	snd_emux_voice_t *voices;	/* Voices (EMU 'channel') */
+	struct snd_sf_list *sflist;	/* root of SoundFont list */
+	struct snd_emux_voice *voices;	/* Voices (EMU 'channel') */
 	int use_time;	/* allocation counter */
 	spinlock_t voice_lock;	/* Lock for voice access */
 	struct semaphore register_mutex;
 	int client;		/* For the sequencer client */
 	int ports[SNDRV_EMUX_MAX_PORTS];	/* The ports for this device */
-	snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS];
+	struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS];
 	int used;	/* use counter */
 	char *name;	/* name of the device (internal) */
-	snd_rawmidi_t **vmidi;
+	struct snd_rawmidi **vmidi;
 	struct timer_list tlist;	/* for pending note-offs */
 	int timer_active;
 
-	snd_util_memhdr_t *memhdr;	/* memory chunk information */
+	struct snd_util_memhdr *memhdr;	/* memory chunk information */
 
 #ifdef CONFIG_PROC_FS
-	snd_info_entry_t *proc;
+	struct snd_info_entry *proc;
 #endif
 
 #ifdef CONFIG_SND_SEQUENCER_OSS
-	snd_seq_device_t *oss_synth;
+	struct snd_seq_device *oss_synth;
 #endif
 };
 
@@ -139,18 +140,18 @@
  */
 struct snd_emux_port {
 
-	snd_midi_channel_set_t chset;
-	snd_emux_t *emu;
+	struct snd_midi_channel_set chset;
+	struct snd_emux *emu;
 
 	char port_mode;			/* operation mode */
 	int volume_atten;		/* emuX raw attenuation */
 	unsigned long drum_flags;	/* drum bitmaps */
 	int ctrls[EMUX_MD_END];		/* control parameters */
 #ifdef SNDRV_EMUX_USE_RAW_EFFECT
-	snd_emux_effect_table_t *effect;
+	struct snd_emux_effect_table *effect;
 #endif
 #ifdef CONFIG_SND_SEQUENCER_OSS
-	snd_seq_oss_arg_t *oss_arg;
+	struct snd_seq_oss_arg *oss_arg;
 #endif
 };
 
@@ -179,16 +180,16 @@
 	unsigned char key;
 	unsigned char velocity;	/* Velocity of current note */
 
-	snd_sf_zone_t *zone;	/* Zone assigned to this note */
+	struct snd_sf_zone *zone;	/* Zone assigned to this note */
 	void *block;		/* sample block pointer (optional) */
-	snd_midi_channel_t *chan;	/* Midi channel for this note */
-	snd_emux_port_t *port;	/* associated port */
-	snd_emux_t *emu;	/* assigned root info */
-	void *hw;		/* hardware pointer (emu8000_t or emu10k1_t) */
+	struct snd_midi_channel *chan;	/* Midi channel for this note */
+	struct snd_emux_port *port;	/* associated port */
+	struct snd_emux *emu;	/* assigned root info */
+	void *hw;		/* hardware pointer (emu8000 or emu10k1) */
 	unsigned long ontime;	/* jiffies at note triggered */
 	
 	/* Emu8k/Emu10k1 registers */
-	soundfont_voice_info_t reg;
+	struct soundfont_voice_info reg;
 
 	/* additional registers */
 	int avol;		/* volume attenuation */
@@ -229,15 +230,15 @@
 /*
  * prototypes - interface to Emu10k1 and Emu8k routines
  */
-int snd_emux_new(snd_emux_t **remu);
-int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name);
-int snd_emux_free(snd_emux_t *emu);
+int snd_emux_new(struct snd_emux **remu);
+int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name);
+int snd_emux_free(struct snd_emux *emu);
 
 /*
  * exported functions
  */
-void snd_emux_terminate_all(snd_emux_t *emu);
-void snd_emux_lock_voice(snd_emux_t *emu, int voice);
-void snd_emux_unlock_voice(snd_emux_t *emu, int voice);
+void snd_emux_terminate_all(struct snd_emux *emu);
+void snd_emux_lock_voice(struct snd_emux *emu, int voice);
+void snd_emux_unlock_voice(struct snd_emux *emu, int voice);
 
 #endif /* __SOUND_EMUX_SYNTH_H */
diff --git a/include/sound/sfnt_info.h b/include/sound/sfnt_info.h
index 674585f..5d1ab9c 100644
--- a/include/sound/sfnt_info.h
+++ b/include/sound/sfnt_info.h
@@ -35,7 +35,7 @@
 #endif
 
 /* patch interface header: 16 bytes */
-typedef struct soundfont_patch_info_t {
+struct soundfont_patch_info {
 	unsigned short key;		/* use the key below */
 #define SNDRV_OSS_SOUNDFONT_PATCH		SNDRV_OSS_PATCHKEY(0x07)
 
@@ -59,7 +59,7 @@
 	short reserved;			/* word alignment data */
 
 	/* the actual patch data begins after this */
-} soundfont_patch_info_t;
+};
 
 
 /*
@@ -68,7 +68,7 @@
 
 #define SNDRV_SFNT_PATCH_NAME_LEN	32
 
-typedef struct soundfont_open_parm_t {
+struct soundfont_open_parm {
 	unsigned short type;		/* sample type */
 #define SNDRV_SFNT_PAT_TYPE_MISC	0
 #define SNDRV_SFNT_PAT_TYPE_GUS	6
@@ -78,7 +78,7 @@
 
 	short reserved;
 	char name[SNDRV_SFNT_PATCH_NAME_LEN];
-} soundfont_open_parm_t;
+};
 
 
 /*
@@ -86,7 +86,7 @@
  */
 
 /* wave table envelope & effect parameters to control EMU8000 */
-typedef struct soundfont_voice_parm_t {
+struct soundfont_voice_parm {
 	unsigned short moddelay;	/* modulation delay (0x8000) */
 	unsigned short modatkhld;	/* modulation attack & hold time (0x7f7f) */
 	unsigned short moddcysus;	/* modulation decay & sustain (0x7f7f) */
@@ -108,11 +108,11 @@
 	unsigned char chorus;		/* chorus send (0x00) */
 	unsigned char reverb;		/* reverb send (0x00) */
 	unsigned short reserved[4];	/* not used */
-} soundfont_voice_parm_t;
+};
 
 
 /* wave table parameters: 92 bytes */
-typedef struct soundfont_voice_info_t {
+struct soundfont_voice_info {
 	unsigned short sf_id;		/* file id (should be zero) */
 	unsigned short sample;		/* sample id */
 	int start, end;			/* sample offset correction */
@@ -135,13 +135,13 @@
 	unsigned char amplitude;	/* sample volume (127 max) */
 	unsigned char attenuation;	/* attenuation (0.375dB) */
 	short scaleTuning;		/* pitch scale tuning(%), normally 100 */
-	soundfont_voice_parm_t parm;	/* voice envelope parameters */
+	struct soundfont_voice_parm parm;	/* voice envelope parameters */
 	unsigned short sample_mode;	/* sample mode_flag (set by driver) */
-} soundfont_voice_info_t;
+};
 
 
 /* instrument info header: 4 bytes */
-typedef struct soundfont_voice_rec_hdr_t {
+struct soundfont_voice_rec_hdr {
 	unsigned char bank;		/* midi bank number */
 	unsigned char instr;		/* midi preset number */
 	char nvoices;			/* number of voices */
@@ -149,7 +149,7 @@
 #define SNDRV_SFNT_WR_APPEND		0	/* append anyway */
 #define SNDRV_SFNT_WR_EXCLUSIVE		1	/* skip if already exists */
 #define SNDRV_SFNT_WR_REPLACE		2	/* replace if already exists */
-} soundfont_voice_rec_hdr_t;
+};
 
 
 /*
@@ -157,7 +157,7 @@
  */
 
 /* wave table sample header: 32 bytes */
-typedef struct soundfont_sample_info_t {
+struct soundfont_sample_info {
 	unsigned short sf_id;		/* file id (should be zero) */
 	unsigned short sample;		/* sample id */
 	int start, end;			/* start & end offset */
@@ -174,17 +174,17 @@
 #define SNDRV_SFNT_SAMPLE_STEREO_RIGHT	64	/* stereo right sound */
 #define SNDRV_SFNT_SAMPLE_REVERSE_LOOP	128	/* reverse looping */
 	unsigned int truesize;		/* used memory size (set by driver) */
-} soundfont_sample_info_t;
+};
 
 
 /*
  * voice preset mapping (aliasing)
  */
 
-typedef struct soundfont_voice_map_t {
+struct soundfont_voice_map {
 	int map_bank, map_instr, map_key;	/* key = -1 means all keys */
 	int src_bank, src_instr, src_key;
-} soundfont_voice_map_t;
+};
 
 
 /*
@@ -195,7 +195,7 @@
 
 #define SNDRV_EMUX_VERSION	((1 << 16) | (0 << 8) | 0)	/* 1.0.0 */
 
-struct sndrv_emux_misc_mode {
+struct snd_emux_misc_mode {
 	int port;	/* -1 = all */
 	int mode;
 	int value;
@@ -204,11 +204,11 @@
 
 enum {
 	SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),
-	SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t),
+	SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info),
 	SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),
 	SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),
 	SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),
-	SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode),
+	SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode),
 };
 
 #endif /* __SOUND_SFNT_INFO_H */
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h
index c992958..61a010c 100644
--- a/include/sound/soundfont.h
+++ b/include/sound/soundfont.h
@@ -29,94 +29,93 @@
 #define SF_MAX_PRESETS  256	/* drums are mapped from 128 to 256 */
 #define SF_IS_DRUM_BANK(z) ((z) == 128)
 
-typedef struct snd_sf_zone {
+struct snd_sf_zone {
 	struct snd_sf_zone *next;	/* Link to next */
 	unsigned char bank;		/* Midi bank for this zone */
 	unsigned char instr;		/* Midi program for this zone */
 	unsigned char mapped;		/* True if mapped to something else */
 
-	soundfont_voice_info_t v;	/* All the soundfont parameters */
+	struct soundfont_voice_info v;	/* All the soundfont parameters */
 	int counter;
 	struct snd_sf_sample *sample;	/* Link to sample */
 
 	/* The following deals with preset numbers (programs) */
 	struct snd_sf_zone *next_instr;	/* Next zone of this instrument */
 	struct snd_sf_zone *next_zone;	/* Next zone in play list */
-} snd_sf_zone_t;
+};
 
-typedef struct snd_sf_sample {
-	soundfont_sample_info_t v;
+struct snd_sf_sample {
+	struct soundfont_sample_info v;
 	int counter;
-	snd_util_memblk_t *block;	/* allocated data block */
+	struct snd_util_memblk *block;	/* allocated data block */
 	struct snd_sf_sample *next;
-} snd_sf_sample_t;
+};
 
 /*
  * This represents all the information relating to a soundfont.
  */
-typedef struct snd_soundfont {
+struct snd_soundfont {
 	struct snd_soundfont *next;	/* Link to next */
 	/*struct snd_soundfont *prev;*/	/* Link to previous */
 	short  id;		/* file id */
 	short  type;		/* font type */
 	unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN];	/* identifier */
-	snd_sf_zone_t *zones; /* Font information */
-	snd_sf_sample_t *samples; /* The sample headers */
-} snd_soundfont_t;
+	struct snd_sf_zone *zones; /* Font information */
+	struct snd_sf_sample *samples; /* The sample headers */
+};
 
 /*
  * Type of the sample access callback
  */
-typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp,
-				   snd_util_memhdr_t *hdr, const void __user *buf, long count);
-typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp,
-				    snd_util_memhdr_t *hdr);
-typedef void (*snd_sf_sample_reset_t)(void *private);
-
-typedef struct snd_sf_callback {
+struct snd_sf_callback {
 	void *private_data;
-	snd_sf_sample_new_t sample_new;
-	snd_sf_sample_free_t sample_free;
-	snd_sf_sample_reset_t sample_reset;
-} snd_sf_callback_t;
+	int (*sample_new)(void *private_data, struct snd_sf_sample *sp,
+			  struct snd_util_memhdr *hdr,
+			  const void __user *buf, long count);
+	int (*sample_free)(void *private_data, struct snd_sf_sample *sp,
+			   struct snd_util_memhdr *hdr);
+	void (*sample_reset)(void *private);
+};
 
 /*
  * List of soundfonts.
  */
-typedef struct snd_sf_list {
-	snd_soundfont_t *currsf; /* The currently open soundfont */
+struct snd_sf_list {
+	struct snd_soundfont *currsf; /* The currently open soundfont */
 	int open_client;	/* client pointer for lock */
 	int mem_used;		/* used memory size */
-	snd_sf_zone_t *presets[SF_MAX_PRESETS];
-	snd_soundfont_t *fonts; /* The list of soundfonts */
+	struct snd_sf_zone *presets[SF_MAX_PRESETS];
+	struct snd_soundfont *fonts; /* The list of soundfonts */
 	int fonts_size;	/* number of fonts allocated */
 	int zone_counter;	/* last allocated time for zone */
 	int sample_counter;	/* last allocated time for sample */
 	int zone_locked;	/* locked time for zone */
 	int sample_locked;	/* locked time for sample */
-	snd_sf_callback_t callback;	/* callback functions */
+	struct snd_sf_callback callback;	/* callback functions */
 	int presets_locked;
 	struct semaphore presets_mutex;
 	spinlock_t lock;
-	snd_util_memhdr_t *memhdr;
-} snd_sf_list_t;
+	struct snd_util_memhdr *memhdr;
+};
 
 /* Prototypes for soundfont.c */
-int snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client);
-int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
+int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
+		       long count, int client);
+int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
 				long count, int client);
-int snd_soundfont_close_check(snd_sf_list_t *sflist, int client);
+int snd_soundfont_close_check(struct snd_sf_list *sflist, int client);
 
-snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr);
-void snd_sf_free(snd_sf_list_t *sflist);
+struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback,
+			       struct snd_util_memhdr *hdr);
+void snd_sf_free(struct snd_sf_list *sflist);
 
-int snd_soundfont_remove_samples(snd_sf_list_t *sflist);
-int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist);
+int snd_soundfont_remove_samples(struct snd_sf_list *sflist);
+int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist);
 
-int snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
+int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
 			      int preset, int bank,
 			      int def_preset, int def_bank,
-			      snd_sf_zone_t **table, int max_layers);
+			      struct snd_sf_zone **table, int max_layers);
 
 /* Parameter conversions */
 int snd_sf_calc_parm_hold(int msec);
diff --git a/include/sound/util_mem.h b/include/sound/util_mem.h
index 9d2cdfa..69944bb 100644
--- a/include/sound/util_mem.h
+++ b/include/sound/util_mem.h
@@ -20,29 +20,25 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  */
 
-typedef struct snd_util_memblk snd_util_memblk_t;
-typedef struct snd_util_memhdr snd_util_memhdr_t;
-typedef unsigned int snd_util_unit_t;
-
 /*
  * memory block
  */
 struct snd_util_memblk {
-	snd_util_unit_t size;		/* size of this block */
-	snd_util_unit_t offset;		/* zero-offset of this block */
+	unsigned int size;		/* size of this block */
+	unsigned int offset;		/* zero-offset of this block */
 	struct list_head list;		/* link */
 };
 
-#define snd_util_memblk_argptr(blk)	(void*)((char*)(blk) + sizeof(snd_util_memblk_t))
+#define snd_util_memblk_argptr(blk)	(void*)((char*)(blk) + sizeof(struct snd_util_memblk))
 
 /*
  * memory management information
  */
 struct snd_util_memhdr {
-	snd_util_unit_t size;		/* size of whole data */
+	unsigned int size;		/* size of whole data */
 	struct list_head block;		/* block linked-list header */
 	int nblocks;			/* # of allocated blocks */
-	snd_util_unit_t used;		/* used memory size */
+	unsigned int used;		/* used memory size */
 	int block_extra_size;		/* extra data size of chunk */
 	struct semaphore block_mutex;	/* lock */
 };
@@ -50,15 +46,17 @@
 /*
  * prototypes
  */
-snd_util_memhdr_t *snd_util_memhdr_new(int memsize);
-void snd_util_memhdr_free(snd_util_memhdr_t *hdr);
-snd_util_memblk_t *snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size);
-int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk);
-int snd_util_mem_avail(snd_util_memhdr_t *hdr);
+struct snd_util_memhdr *snd_util_memhdr_new(int memsize);
+void snd_util_memhdr_free(struct snd_util_memhdr *hdr);
+struct snd_util_memblk *snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);
+int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);
+int snd_util_mem_avail(struct snd_util_memhdr *hdr);
 
 /* functions without mutex */
-snd_util_memblk_t *__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size);
-void __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk);
-snd_util_memblk_t *__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, struct list_head *prev);
+struct snd_util_memblk *__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);
+void __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);
+struct snd_util_memblk *__snd_util_memblk_new(struct snd_util_memhdr *hdr,
+					      unsigned int units,
+					      struct list_head *prev);
 
 #endif /* __SOUND_UTIL_MEM_H */
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c
index 2aacd8a..7c8e328 100644
--- a/sound/synth/emux/emux.c
+++ b/sound/synth/emux/emux.c
@@ -35,9 +35,9 @@
 /*
  * create a new hardware dependent device for Emu8000/Emu10k1
  */
-int snd_emux_new(snd_emux_t **remu)
+int snd_emux_new(struct snd_emux **remu)
 {
-	snd_emux_t *emu;
+	struct snd_emux *emu;
 
 	*remu = NULL;
 	emu = kzalloc(sizeof(*emu), GFP_KERNEL);
@@ -66,33 +66,33 @@
 
 /*
  */
-static int sf_sample_new(void *private_data, snd_sf_sample_t *sp,
-			 snd_util_memhdr_t *hdr,
-			 const void __user *buf, long count)
+static int sf_sample_new(void *private_data, struct snd_sf_sample *sp,
+				  struct snd_util_memhdr *hdr,
+				  const void __user *buf, long count)
 {
-	snd_emux_t *emu = private_data;
+	struct snd_emux *emu = private_data;
 	return emu->ops.sample_new(emu, sp, hdr, buf, count);
 	
 }
 
-static int sf_sample_free(void *private_data, snd_sf_sample_t *sp,
-			  snd_util_memhdr_t *hdr)
+static int sf_sample_free(void *private_data, struct snd_sf_sample *sp,
+				   struct snd_util_memhdr *hdr)
 {
-	snd_emux_t *emu = private_data;
+	struct snd_emux *emu = private_data;
 	return emu->ops.sample_free(emu, sp, hdr);
 	
 }
 
 static void sf_sample_reset(void *private_data)
 {
-	snd_emux_t *emu = private_data;
+	struct snd_emux *emu = private_data;
 	emu->ops.sample_reset(emu);
 }
 
-int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name)
+int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name)
 {
 	int err;
-	snd_sf_callback_t sf_cb;
+	struct snd_sf_callback sf_cb;
 
 	snd_assert(emu->hw != NULL, return -EINVAL);
 	snd_assert(emu->max_voices > 0, return -EINVAL);
@@ -101,7 +101,8 @@
 
 	emu->card = card;
 	emu->name = kstrdup(name, GFP_KERNEL);
-	emu->voices = kcalloc(emu->max_voices, sizeof(snd_emux_voice_t), GFP_KERNEL);
+	emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice),
+			      GFP_KERNEL);
 	if (emu->voices == NULL)
 		return -ENOMEM;
 
@@ -138,7 +139,7 @@
 
 /*
  */
-int snd_emux_free(snd_emux_t *emu)
+int snd_emux_free(struct snd_emux *emu)
 {
 	unsigned long flags;
 
diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c
index 4764940..a447218 100644
--- a/sound/synth/emux/emux_effect.c
+++ b/sound/synth/emux/emux_effect.c
@@ -32,7 +32,7 @@
 
 #define xoffsetof(type,tag)	((long)(&((type)NULL)->tag) - (long)(NULL))
 
-#define parm_offset(tag)	xoffsetof(soundfont_voice_parm_t*, tag)
+#define parm_offset(tag)	xoffsetof(struct soundfont_voice_parm *, tag)
 
 #define PARM_IS_BYTE		(1 << 0)
 #define PARM_IS_WORD		(1 << 1)
@@ -97,10 +97,10 @@
 
 /* set byte effect value */
 static void
-effect_set_byte(unsigned char *valp, snd_midi_channel_t *chan, int type)
+effect_set_byte(unsigned char *valp, struct snd_midi_channel *chan, int type)
 {
 	short effect;
-	snd_emux_effect_table_t *fx = chan->private;
+	struct snd_emux_effect_table *fx = chan->private;
 
 	effect = fx->val[type];
 	if (fx->flag[type] == EMUX_FX_FLAG_ADD) {
@@ -118,10 +118,10 @@
 
 /* set word effect value */
 static void
-effect_set_word(unsigned short *valp, snd_midi_channel_t *chan, int type)
+effect_set_word(unsigned short *valp, struct snd_midi_channel *chan, int type)
 {
 	int effect;
-	snd_emux_effect_table_t *fx = chan->private;
+	struct snd_emux_effect_table *fx = chan->private;
 
 	effect = *(unsigned short*)&fx->val[type];
 	if (fx->flag[type] == EMUX_FX_FLAG_ADD)
@@ -135,10 +135,10 @@
 
 /* address offset */
 static int
-effect_get_offset(snd_midi_channel_t *chan, int lo, int hi, int mode)
+effect_get_offset(struct snd_midi_channel *chan, int lo, int hi, int mode)
 {
 	int addr = 0;
-	snd_emux_effect_table_t *fx = chan->private;
+	struct snd_emux_effect_table *fx = chan->private;
 
 	if (fx->flag[hi])
 		addr = (short)fx->val[hi];
@@ -153,7 +153,8 @@
 #ifdef CONFIG_SND_SEQUENCER_OSS
 /* change effects - for OSS sequencer compatibility */
 void
-snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val)
+snd_emux_send_effect_oss(struct snd_emux_port *port,
+			 struct snd_midi_channel *chan, int type, int val)
 {
 	int mode;
 
@@ -173,13 +174,14 @@
  * if update is necessary, call emu8000_control
  */
 void
-snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode)
+snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan,
+		     int type, int val, int mode)
 {
 	int i;
 	int offset;
 	unsigned char *srcp, *origp;
-	snd_emux_t *emu;
-	snd_emux_effect_table_t *fx;
+	struct snd_emux *emu;
+	struct snd_emux_effect_table *fx;
 	unsigned long flags;
 
 	emu = port->emu;
@@ -206,7 +208,7 @@
 	/* modify the register values */
 	spin_lock_irqsave(&emu->voice_lock, flags);
 	for (i = 0; i < emu->max_voices; i++) {
-		snd_emux_voice_t *vp = &emu->voices[i];
+		struct snd_emux_voice *vp = &emu->voices[i];
 		if (!STATE_IS_PLAYING(vp->state) || vp->chan != chan)
 			continue;
 		srcp = (unsigned char*)&vp->reg.parm + offset;
@@ -228,10 +230,10 @@
 
 /* copy wavetable registers to voice table */
 void
-snd_emux_setup_effect(snd_emux_voice_t *vp)
+snd_emux_setup_effect(struct snd_emux_voice *vp)
 {
-	snd_midi_channel_t *chan = vp->chan;
-	snd_emux_effect_table_t *fx;
+	struct snd_midi_channel *chan = vp->chan;
+	struct snd_emux_effect_table *fx;
 	unsigned char *srcp;
 	int i;
 
@@ -275,10 +277,11 @@
  * effect table
  */
 void
-snd_emux_create_effect(snd_emux_port_t *p)
+snd_emux_create_effect(struct snd_emux_port *p)
 {
 	int i;
-	p->effect = kcalloc(p->chset.max_channels, sizeof(snd_emux_effect_table_t), GFP_KERNEL);
+	p->effect = kcalloc(p->chset.max_channels,
+			    sizeof(struct snd_emux_effect_table), GFP_KERNEL);
 	if (p->effect) {
 		for (i = 0; i < p->chset.max_channels; i++)
 			p->chset.channels[i].private = p->effect + i;
@@ -289,17 +292,18 @@
 }
 
 void
-snd_emux_delete_effect(snd_emux_port_t *p)
+snd_emux_delete_effect(struct snd_emux_port *p)
 {
 	kfree(p->effect);
 	p->effect = NULL;
 }
 
 void
-snd_emux_clear_effect(snd_emux_port_t *p)
+snd_emux_clear_effect(struct snd_emux_port *p)
 {
 	if (p->effect) {
-		memset(p->effect, 0, sizeof(snd_emux_effect_table_t) * p->chset.max_channels);
+		memset(p->effect, 0, sizeof(struct snd_emux_effect_table) *
+		       p->chset.max_channels);
 	}
 }
 
diff --git a/sound/synth/emux/emux_hwdep.c b/sound/synth/emux/emux_hwdep.c
index 4182b44..9b63814 100644
--- a/sound/synth/emux/emux_hwdep.c
+++ b/sound/synth/emux/emux_hwdep.c
@@ -29,7 +29,7 @@
  * open the hwdep device
  */
 static int
-snd_emux_hwdep_open(snd_hwdep_t *hw, struct file *file)
+snd_emux_hwdep_open(struct snd_hwdep *hw, struct file *file)
 {
 	return 0;
 }
@@ -39,7 +39,7 @@
  * close the device
  */
 static int
-snd_emux_hwdep_release(snd_hwdep_t *hw, struct file *file)
+snd_emux_hwdep_release(struct snd_hwdep *hw, struct file *file)
 {
 	return 0;
 }
@@ -51,10 +51,10 @@
  * load patch
  */
 static int
-snd_emux_hwdep_load_patch(snd_emux_t *emu, void __user *arg)
+snd_emux_hwdep_load_patch(struct snd_emux *emu, void __user *arg)
 {
 	int err;
-	soundfont_patch_info_t patch;
+	struct soundfont_patch_info patch;
 
 	if (copy_from_user(&patch, arg, sizeof(patch)))
 		return -EFAULT;
@@ -77,9 +77,9 @@
  * set misc mode
  */
 static int
-snd_emux_hwdep_misc_mode(snd_emux_t *emu, void __user *arg)
+snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg)
 {
-	struct sndrv_emux_misc_mode info;
+	struct snd_emux_misc_mode info;
 	int i;
 
 	if (copy_from_user(&info, arg, sizeof(info)))
@@ -102,9 +102,10 @@
  * ioctl
  */
 static int
-snd_emux_hwdep_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg)
+snd_emux_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
+		     unsigned int cmd, unsigned long arg)
 {
-	snd_emux_t *emu = hw->private_data;
+	struct snd_emux *emu = hw->private_data;
 
 	switch (cmd) {
 	case SNDRV_EMUX_IOCTL_VERSION:
@@ -136,9 +137,9 @@
  */
 
 int
-snd_emux_init_hwdep(snd_emux_t *emu)
+snd_emux_init_hwdep(struct snd_emux *emu)
 {
-	snd_hwdep_t *hw;
+	struct snd_hwdep *hw;
 	int err;
 
 	if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0)
@@ -162,7 +163,7 @@
  * unregister
  */
 void
-snd_emux_delete_hwdep(snd_emux_t *emu)
+snd_emux_delete_hwdep(struct snd_emux *emu)
 {
 	if (emu->hwdep) {
 		snd_device_free(emu->card, emu->hwdep);
diff --git a/sound/synth/emux/emux_nrpn.c b/sound/synth/emux/emux_nrpn.c
index 25edff9..c6917ba 100644
--- a/sound/synth/emux/emux_nrpn.c
+++ b/sound/synth/emux/emux_nrpn.c
@@ -27,11 +27,11 @@
  */
 
 /* NRPN / CC -> Emu8000 parameter converter */
-typedef struct {
+struct nrpn_conv_table {
 	int control;
 	int effect;
 	int (*convert)(int val);
-} nrpn_conv_table;
+};
 
 /* effect sensitivity */
 
@@ -48,8 +48,9 @@
  * convert NRPN/control values
  */
 
-static int send_converted_effect(nrpn_conv_table *table, int num_tables,
-				 snd_emux_port_t *port, snd_midi_channel_t *chan,
+static int send_converted_effect(struct nrpn_conv_table *table, int num_tables,
+				 struct snd_emux_port *port,
+				 struct snd_midi_channel *chan,
 				 int type, int val, int mode)
 {
 	int i, cval;
@@ -178,7 +179,7 @@
 }
 
 
-static nrpn_conv_table awe_effects[] =
+static struct nrpn_conv_table awe_effects[] =
 {
 	{ 0, EMUX_FX_LFO1_DELAY,	fx_lfo1_delay},
 	{ 1, EMUX_FX_LFO1_FREQ,	fx_lfo1_freq},
@@ -265,7 +266,7 @@
 	return -(val - 64) * gs_sense[FX_VIBDELAY] / 50;
 }
 
-static nrpn_conv_table gs_effects[] =
+static struct nrpn_conv_table gs_effects[] =
 {
 	{32, EMUX_FX_CUTOFF,	gs_cutoff},
 	{33, EMUX_FX_FILTERQ,	gs_filterQ},
@@ -282,9 +283,10 @@
  * NRPN events
  */
 void
-snd_emux_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset)
+snd_emux_nrpn(void *p, struct snd_midi_channel *chan,
+	      struct snd_midi_channel_set *chset)
 {
-	snd_emux_port_t *port;
+	struct snd_emux_port *port;
 
 	port = p;
 	snd_assert(port != NULL, return);
@@ -348,7 +350,7 @@
 	return -(val - 64) * xg_sense[FX_RELEASE] / 64;
 }
 
-static nrpn_conv_table xg_effects[] =
+static struct nrpn_conv_table xg_effects[] =
 {
 	{71, EMUX_FX_CUTOFF,	xg_cutoff},
 	{74, EMUX_FX_FILTERQ,	xg_filterQ},
@@ -357,7 +359,8 @@
 };
 
 int
-snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param)
+snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan,
+		    int param)
 {
 	return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
 				     port, chan, param,
@@ -369,10 +372,11 @@
  * receive sysex
  */
 void
-snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset)
+snd_emux_sysex(void *p, unsigned char *buf, int len, int parsed,
+	       struct snd_midi_channel_set *chset)
 {
-	snd_emux_port_t *port;
-	snd_emux_t *emu;
+	struct snd_emux_port *port;
+	struct snd_emux *emu;
 
 	port = p;
 	snd_assert(port != NULL, return);
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index 5272f4a..dfbfcfb 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -31,19 +31,25 @@
 #include "emux_voice.h"
 #include <sound/asoundef.h>
 
-static int snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure);
-static int snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg);
-static int snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg);
-static int snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count);
-static int snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg);
-static int snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop);
-static void reset_port_mode(snd_emux_port_t *port, int midi_mode);
-static void emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop);
-static void gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd, unsigned char *event, int atomic, int hop);
-static void fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop);
+static int snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure);
+static int snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg);
+static int snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
+				  unsigned long ioarg);
+static int snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
+				       const char __user *buf, int offs, int count);
+static int snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg);
+static int snd_emux_event_oss_input(struct snd_seq_event *ev, int direct,
+				    void *private, int atomic, int hop);
+static void reset_port_mode(struct snd_emux_port *port, int midi_mode);
+static void emuspec_control(struct snd_emux *emu, struct snd_emux_port *port,
+			    int cmd, unsigned char *event, int atomic, int hop);
+static void gusspec_control(struct snd_emux *emu, struct snd_emux_port *port,
+			    int cmd, unsigned char *event, int atomic, int hop);
+static void fake_event(struct snd_emux *emu, struct snd_emux_port *port,
+		       int ch, int param, int val, int atomic, int hop);
 
 /* operators */
-static snd_seq_oss_callback_t oss_callback = {
+static struct snd_seq_oss_callback oss_callback = {
 	.owner = THIS_MODULE,
 	.open = snd_emux_open_seq_oss,
 	.close = snd_emux_close_seq_oss,
@@ -58,13 +64,13 @@
  */
 
 void
-snd_emux_init_seq_oss(snd_emux_t *emu)
+snd_emux_init_seq_oss(struct snd_emux *emu)
 {
-	snd_seq_oss_reg_t *arg;
-	snd_seq_device_t *dev;
+	struct snd_seq_oss_reg *arg;
+	struct snd_seq_device *dev;
 
 	if (snd_seq_device_new(emu->card, 0, SNDRV_SEQ_DEV_ID_OSS,
-			       sizeof(snd_seq_oss_reg_t), &dev) < 0)
+			       sizeof(struct snd_seq_oss_reg), &dev) < 0)
 		return;
 
 	emu->oss_synth = dev;
@@ -85,7 +91,7 @@
  * unregister
  */
 void
-snd_emux_detach_seq_oss(snd_emux_t *emu)
+snd_emux_detach_seq_oss(struct snd_emux *emu)
 {
 	if (emu->oss_synth) {
 		snd_device_free(emu->card, emu->oss_synth);
@@ -101,11 +107,11 @@
  * open port for OSS sequencer
  */
 static int
-snd_emux_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
+snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
 {
-	snd_emux_t *emu;
-	snd_emux_port_t *p;
-	snd_seq_port_callback_t callback;
+	struct snd_emux *emu;
+	struct snd_emux_port *p;
+	struct snd_seq_port_callback callback;
 	char tmpname[64];
 
 	emu = closure;
@@ -153,7 +159,7 @@
  * reset port mode
  */
 static void
-reset_port_mode(snd_emux_port_t *port, int midi_mode)
+reset_port_mode(struct snd_emux_port *port, int midi_mode)
 {
 	if (midi_mode) {
 		port->port_mode = SNDRV_EMUX_PORT_MODE_OSS_MIDI;
@@ -173,10 +179,10 @@
  * close port
  */
 static int
-snd_emux_close_seq_oss(snd_seq_oss_arg_t *arg)
+snd_emux_close_seq_oss(struct snd_seq_oss_arg *arg)
 {
-	snd_emux_t *emu;
-	snd_emux_port_t *p;
+	struct snd_emux *emu;
+	struct snd_emux_port *p;
 
 	snd_assert(arg != NULL, return -ENXIO);
 	p = arg->private_data;
@@ -200,11 +206,11 @@
  * load patch
  */
 static int
-snd_emux_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
+snd_emux_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
 			    const char __user *buf, int offs, int count)
 {
-	snd_emux_t *emu;
-	snd_emux_port_t *p;
+	struct snd_emux *emu;
+	struct snd_emux_port *p;
 	int rc;
 
 	snd_assert(arg != NULL, return -ENXIO);
@@ -218,7 +224,7 @@
 		rc = snd_soundfont_load_guspatch(emu->sflist, buf, count,
 						 SF_CLIENT_NO(p->chset.port));
 	else if (format == SNDRV_OSS_SOUNDFONT_PATCH) {
-		soundfont_patch_info_t patch;
+		struct soundfont_patch_info patch;
 		if (count < (int)sizeof(patch))
 			rc = -EINVAL;
 		if (copy_from_user(&patch, buf, sizeof(patch)))
@@ -242,10 +248,10 @@
  * ioctl
  */
 static int
-snd_emux_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg)
+snd_emux_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg)
 {
-	snd_emux_port_t *p;
-	snd_emux_t *emu;
+	struct snd_emux_port *p;
+	struct snd_emux *emu;
 
 	snd_assert(arg != NULL, return -ENXIO);
 	p = arg->private_data;
@@ -273,9 +279,9 @@
  * reset device
  */
 static int
-snd_emux_reset_seq_oss(snd_seq_oss_arg_t *arg)
+snd_emux_reset_seq_oss(struct snd_seq_oss_arg *arg)
 {
-	snd_emux_port_t *p;
+	struct snd_emux_port *p;
 
 	snd_assert(arg != NULL, return -ENXIO);
 	p = arg->private_data;
@@ -289,11 +295,11 @@
  * receive raw events: only SEQ_PRIVATE is accepted.
  */
 static int
-snd_emux_event_oss_input(snd_seq_event_t *ev, int direct, void *private_data,
+snd_emux_event_oss_input(struct snd_seq_event *ev, int direct, void *private_data,
 			 int atomic, int hop)
 {
-	snd_emux_t *emu;
-	snd_emux_port_t *p;
+	struct snd_emux *emu;
+	struct snd_emux_port *p;
 	unsigned char cmd, *data;
 
 	p = private_data;
@@ -320,14 +326,14 @@
  * OSS/AWE driver specific h/w controls
  */
 static void
-emuspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
+emuspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd,
 		unsigned char *event, int atomic, int hop)
 {
 	int voice;
 	unsigned short p1;
 	short p2;
 	int i;
-	snd_midi_channel_t *chan;
+	struct snd_midi_channel *chan;
 
 	voice = event[3];
 	if (voice < 0 || voice >= port->chset.max_channels)
@@ -415,14 +421,14 @@
 #include <linux/ultrasound.h>
 
 static void
-gusspec_control(snd_emux_t *emu, snd_emux_port_t *port, int cmd,
+gusspec_control(struct snd_emux *emu, struct snd_emux_port *port, int cmd,
 		unsigned char *event, int atomic, int hop)
 {
 	int voice;
 	unsigned short p1;
 	short p2;
 	int plong;
-	snd_midi_channel_t *chan;
+	struct snd_midi_channel *chan;
 
 	if (port->port_mode != SNDRV_EMUX_PORT_MODE_OSS_SYNTH)
 		return;
@@ -483,9 +489,9 @@
  * send an event to midi emulation
  */
 static void
-fake_event(snd_emux_t *emu, snd_emux_port_t *port, int ch, int param, int val, int atomic, int hop)
+fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop)
 {
-	snd_seq_event_t ev;
+	struct snd_seq_event ev;
 	memset(&ev, 0, sizeof(ev));
 	ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
 	ev.data.control.channel = ch;
diff --git a/sound/synth/emux/emux_proc.c b/sound/synth/emux/emux_proc.c
index 0f155d6..a70a179 100644
--- a/sound/synth/emux/emux_proc.c
+++ b/sound/synth/emux/emux_proc.c
@@ -30,10 +30,10 @@
 #ifdef CONFIG_PROC_FS
 
 static void
-snd_emux_proc_info_read(snd_info_entry_t *entry, 
-			snd_info_buffer_t *buf)
+snd_emux_proc_info_read(struct snd_info_entry *entry, 
+			struct snd_info_buffer *buf)
 {
-	snd_emux_t *emu;
+	struct snd_emux *emu;
 	int i;
 
 	emu = entry->private_data;
@@ -66,7 +66,7 @@
 	}
 #if 0  /* debug */
 	if (emu->voices[0].state != SNDRV_EMUX_ST_OFF && emu->voices[0].ch >= 0) {
-		snd_emux_voice_t *vp = &emu->voices[0];
+		struct snd_emux_voice *vp = &emu->voices[0];
 		snd_iprintf(buf, "voice 0: on\n");
 		snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n",
 			    vp->reg.parm.moddelay,
@@ -107,9 +107,9 @@
 }
 
 
-void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device)
+void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device)
 {
-	snd_info_entry_t *entry;
+	struct snd_info_entry *entry;
 	char name[64];
 
 	sprintf(name, "wavetableD%d", device);
@@ -127,7 +127,7 @@
 		emu->proc = entry;
 }
 
-void snd_emux_proc_free(snd_emux_t *emu)
+void snd_emux_proc_free(struct snd_emux *emu)
 {
 	if (emu->proc) {
 		snd_info_unregister(emu->proc);
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 8ccd33f..f5a832f 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -25,15 +25,15 @@
 
 /* Prototypes for static functions */
 static void free_port(void *private);
-static void snd_emux_init_port(snd_emux_port_t *p);
-static int snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info);
-static int snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info);
-static int get_client(snd_card_t *card, int index, char *name);
+static void snd_emux_init_port(struct snd_emux_port *p);
+static int snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info);
+static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info);
+static int get_client(struct snd_card *card, int index, char *name);
 
 /*
  * MIDI emulation operators
  */
-static snd_midi_op_t emux_ops = {
+static struct snd_midi_op emux_ops = {
 	snd_emux_note_on,
 	snd_emux_note_off,
 	snd_emux_key_press,
@@ -65,10 +65,10 @@
  * can connect to these ports to play midi data.
  */
 int
-snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index)
+snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
 {
 	int  i;
-	snd_seq_port_callback_t pinfo;
+	struct snd_seq_port_callback pinfo;
 	char tmpname[64];
 
 	sprintf(tmpname, "%s WaveTable", emu->name);
@@ -94,7 +94,7 @@
 	pinfo.event_input = snd_emux_event_input;
 
 	for (i = 0; i < emu->num_ports; i++) {
-		snd_emux_port_t *p;
+		struct snd_emux_port *p;
 
 		sprintf(tmpname, "%s Port %d", emu->name, i);
 		p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS,
@@ -119,7 +119,7 @@
  * destroy the kernel client.
  */
 void
-snd_emux_detach_seq(snd_emux_t *emu)
+snd_emux_detach_seq(struct snd_emux *emu)
 {
 	if (emu->voices)
 		snd_emux_terminate_all(emu);
@@ -137,12 +137,12 @@
  * create a sequencer port and channel_set
  */
 
-snd_emux_port_t *
-snd_emux_create_port(snd_emux_t *emu, char *name,
-			int max_channels, int oss_port,
-			snd_seq_port_callback_t *callback)
+struct snd_emux_port *
+snd_emux_create_port(struct snd_emux *emu, char *name,
+		     int max_channels, int oss_port,
+		     struct snd_seq_port_callback *callback)
 {
-	snd_emux_port_t *p;
+	struct snd_emux_port *p;
 	int i, type, cap;
 
 	/* Allocate structures for this channel */
@@ -150,7 +150,7 @@
 		snd_printk("no memory\n");
 		return NULL;
 	}
-	p->chset.channels = kcalloc(max_channels, sizeof(snd_midi_channel_t), GFP_KERNEL);
+	p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL);
 	if (p->chset.channels == NULL) {
 		snd_printk("no memory\n");
 		kfree(p);
@@ -190,7 +190,7 @@
 static void
 free_port(void *private_data)
 {
-	snd_emux_port_t *p;
+	struct snd_emux_port *p;
 
 	p = private_data;
 	if (p) {
@@ -209,7 +209,7 @@
  * initialize the port specific parameters
  */
 static void
-snd_emux_init_port(snd_emux_port_t *p)
+snd_emux_init_port(struct snd_emux_port *p)
 {
 	p->drum_flags = DEFAULT_DRUM_FLAGS;
 	p->volume_atten = 0;
@@ -222,7 +222,7 @@
  * reset port
  */
 void
-snd_emux_reset_port(snd_emux_port_t *port)
+snd_emux_reset_port(struct snd_emux_port *port)
 {
 	int i;
 
@@ -241,7 +241,7 @@
 	port->ctrls[EMUX_MD_REALTIME_PAN] = 1;
 
 	for (i = 0; i < port->chset.max_channels; i++) {
-		snd_midi_channel_t *chan = port->chset.channels + i;
+		struct snd_midi_channel *chan = port->chset.channels + i;
 		chan->drum_channel = ((port->drum_flags >> i) & 1) ? 1 : 0;
 	}
 }
@@ -251,10 +251,10 @@
  * input sequencer event
  */
 int
-snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private_data,
+snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private_data,
 		     int atomic, int hop)
 {
-	snd_emux_port_t *port;
+	struct snd_emux_port *port;
 
 	port = private_data;
 	snd_assert(port != NULL && ev != NULL, return -EINVAL);
@@ -269,7 +269,7 @@
  * increment usage count
  */
 int
-snd_emux_inc_count(snd_emux_t *emu)
+snd_emux_inc_count(struct snd_emux *emu)
 {
 	emu->used++;
 	if (!try_module_get(emu->ops.owner))
@@ -288,7 +288,7 @@
  * decrease usage count
  */
 void
-snd_emux_dec_count(snd_emux_t *emu)
+snd_emux_dec_count(struct snd_emux *emu)
 {
 	module_put(emu->card->module);
 	emu->used--;
@@ -302,10 +302,10 @@
  * Routine that is called upon a first use of a particular port
  */
 static int
-snd_emux_use(void *private_data, snd_seq_port_subscribe_t *info)
+snd_emux_use(void *private_data, struct snd_seq_port_subscribe *info)
 {
-	snd_emux_port_t *p;
-	snd_emux_t *emu;
+	struct snd_emux_port *p;
+	struct snd_emux *emu;
 
 	p = private_data;
 	snd_assert(p != NULL, return -EINVAL);
@@ -323,10 +323,10 @@
  * Routine that is called upon the last unuse() of a particular port.
  */
 static int
-snd_emux_unuse(void *private_data, snd_seq_port_subscribe_t *info)
+snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *info)
 {
-	snd_emux_port_t *p;
-	snd_emux_t *emu;
+	struct snd_emux_port *p;
+	struct snd_emux *emu;
 
 	p = private_data;
 	snd_assert(p != NULL, return -EINVAL);
@@ -345,10 +345,10 @@
  * Create a sequencer client
  */
 static int
-get_client(snd_card_t *card, int index, char *name)
+get_client(struct snd_card *card, int index, char *name)
 {
-	snd_seq_client_callback_t callbacks;
-	snd_seq_client_info_t cinfo;
+	struct snd_seq_client_callback callbacks;
+	struct snd_seq_client_info cinfo;
 	int client;
 
 	memset(&callbacks, 0, sizeof(callbacks));
@@ -374,7 +374,7 @@
 /*
  * attach virtual rawmidi devices
  */
-int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card)
+int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)
 {
 	int i;
 
@@ -382,13 +382,13 @@
 	if (emu->midi_ports <= 0)
 		return 0;
 
-	emu->vmidi = kcalloc(emu->midi_ports, sizeof(snd_rawmidi_t*), GFP_KERNEL);
+	emu->vmidi = kcalloc(emu->midi_ports, sizeof(struct snd_rawmidi *), GFP_KERNEL);
 	if (emu->vmidi == NULL)
 		return -ENOMEM;
 
 	for (i = 0; i < emu->midi_ports; i++) {
-		snd_rawmidi_t *rmidi;
-		snd_virmidi_dev_t *rdev;
+		struct snd_rawmidi *rmidi;
+		struct snd_virmidi_dev *rdev;
 		if (snd_virmidi_new(card, emu->midi_devidx + i, &rmidi) < 0)
 			goto __error;
 		rdev = rmidi->private_data;
@@ -411,7 +411,7 @@
 	return -ENOMEM;
 }
 
-int snd_emux_delete_virmidi(snd_emux_t *emu)
+int snd_emux_delete_virmidi(struct snd_emux *emu)
 {
 	int i;
 
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c
index bd71b73..c387a83 100644
--- a/sound/synth/emux/emux_synth.c
+++ b/sound/synth/emux/emux_synth.c
@@ -36,30 +36,34 @@
 #define LIMITVALUE(x, a, b) do { if ((x) < (a)) (x) = (a); else if ((x) > (b)) (x) = (b); } while (0)
 #define LIMITMAX(x, a) do {if ((x) > (a)) (x) = (a); } while (0)
 
-static int get_zone(snd_emux_t *emu, snd_emux_port_t *port, int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table);
-static int get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan);
-static void terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free);
-static void exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass);
-static void terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free);
-static void update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update);
-static void setup_voice(snd_emux_voice_t *vp);
-static int calc_pan(snd_emux_voice_t *vp);
-static int calc_volume(snd_emux_voice_t *vp);
-static int calc_pitch(snd_emux_voice_t *vp);
+static int get_zone(struct snd_emux *emu, struct snd_emux_port *port,
+		    int *notep, int vel, struct snd_midi_channel *chan,
+		    struct snd_sf_zone **table);
+static int get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan);
+static void terminate_note1(struct snd_emux *emu, int note,
+			    struct snd_midi_channel *chan, int free);
+static void exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port,
+			       int exclass);
+static void terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free);
+static void update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update);
+static void setup_voice(struct snd_emux_voice *vp);
+static int calc_pan(struct snd_emux_voice *vp);
+static int calc_volume(struct snd_emux_voice *vp);
+static int calc_pitch(struct snd_emux_voice *vp);
 
 
 /*
  * Start a note.
  */
 void
-snd_emux_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
+snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
 {
-	snd_emux_t *emu;
+	struct snd_emux *emu;
 	int i, key, nvoices;
-	snd_emux_voice_t *vp;
-	snd_sf_zone_t *table[SNDRV_EMUX_MAX_MULTI_VOICES];
+	struct snd_emux_voice *vp;
+	struct snd_sf_zone *table[SNDRV_EMUX_MAX_MULTI_VOICES];
 	unsigned long flags;
-	snd_emux_port_t *port;
+	struct snd_emux_port *port;
 
 	port = p;
 	snd_assert(port != NULL && chan != NULL, return);
@@ -76,7 +80,7 @@
 
 	/* exclusive note off */
 	for (i = 0; i < nvoices; i++) {
-		snd_sf_zone_t *zp = table[i];
+		struct snd_sf_zone *zp = table[i];
 		if (zp && zp->v.exclusiveClass)
 			exclusive_note_off(emu, port, zp->v.exclusiveClass);
 	}
@@ -138,7 +142,7 @@
 #ifdef SNDRV_EMUX_USE_RAW_EFFECT
 	if (port->port_mode == SNDRV_EMUX_PORT_MODE_OSS_SYNTH) {
 		/* clear voice position for the next note on this channel */
-		snd_emux_effect_table_t *fx = chan->private;
+		struct snd_emux_effect_table *fx = chan->private;
 		if (fx) {
 			fx->flag[EMUX_FX_SAMPLE_START] = 0;
 			fx->flag[EMUX_FX_COARSE_SAMPLE_START] = 0;
@@ -151,13 +155,13 @@
  * Release a note in response to a midi note off.
  */
 void
-snd_emux_note_off(void *p, int note, int vel, snd_midi_channel_t *chan)
+snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan)
 {
 	int ch;
-	snd_emux_t *emu;
-	snd_emux_voice_t *vp;
+	struct snd_emux *emu;
+	struct snd_emux_voice *vp;
 	unsigned long flags;
-	snd_emux_port_t *port;
+	struct snd_emux_port *port;
 
 	port = p;
 	snd_assert(port != NULL && chan != NULL, return);
@@ -199,8 +203,8 @@
  */
 void snd_emux_timer_callback(unsigned long data)
 {
-	snd_emux_t *emu = (snd_emux_t*) data;
-	snd_emux_voice_t *vp;
+	struct snd_emux *emu = (struct snd_emux *) data;
+	struct snd_emux_voice *vp;
 	int ch, do_again = 0;
 
 	spin_lock(&emu->voice_lock);
@@ -228,13 +232,13 @@
  * key pressure change
  */
 void
-snd_emux_key_press(void *p, int note, int vel, snd_midi_channel_t *chan)
+snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)
 {
 	int ch;
-	snd_emux_t *emu;
-	snd_emux_voice_t *vp;
+	struct snd_emux *emu;
+	struct snd_emux_voice *vp;
 	unsigned long flags;
-	snd_emux_port_t *port;
+	struct snd_emux_port *port;
 
 	port = p;
 	snd_assert(port != NULL && chan != NULL, return);
@@ -260,10 +264,10 @@
  * Modulate the voices which belong to the channel
  */
 void
-snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update)
+snd_emux_update_channel(struct snd_emux_port *port, struct snd_midi_channel *chan, int update)
 {
-	snd_emux_t *emu;
-	snd_emux_voice_t *vp;
+	struct snd_emux *emu;
+	struct snd_emux_voice *vp;
 	int i;
 	unsigned long flags;
 
@@ -287,10 +291,10 @@
  * Modulate all the voices which belong to the port.
  */
 void
-snd_emux_update_port(snd_emux_port_t *port, int update)
+snd_emux_update_port(struct snd_emux_port *port, int update)
 {
-	snd_emux_t *emu; 
-	snd_emux_voice_t *vp;
+	struct snd_emux *emu; 
+	struct snd_emux_voice *vp;
 	int i;
 	unsigned long flags;
 
@@ -316,9 +320,9 @@
  * control events, not just the midi controllers
  */
 void
-snd_emux_control(void *p, int type, snd_midi_channel_t *chan)
+snd_emux_control(void *p, int type, struct snd_midi_channel *chan)
 {
-	snd_emux_port_t *port;
+	struct snd_emux_port *port;
 
 	port = p;
 	snd_assert(port != NULL && chan != NULL, return);
@@ -364,10 +368,10 @@
  * terminate note - if free flag is true, free the terminated voice
  */
 static void
-terminate_note1(snd_emux_t *emu, int note, snd_midi_channel_t *chan, int free)
+terminate_note1(struct snd_emux *emu, int note, struct snd_midi_channel *chan, int free)
 {
 	int  i;
-	snd_emux_voice_t *vp;
+	struct snd_emux_voice *vp;
 	unsigned long flags;
 
 	spin_lock_irqsave(&emu->voice_lock, flags);
@@ -385,10 +389,10 @@
  * terminate note - exported for midi emulation
  */
 void
-snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan)
+snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan)
 {
-	snd_emux_t *emu;
-	snd_emux_port_t *port;
+	struct snd_emux *emu;
+	struct snd_emux_port *port;
 
 	port = p;
 	snd_assert(port != NULL && chan != NULL, return);
@@ -405,10 +409,10 @@
  * Terminate all the notes
  */
 void
-snd_emux_terminate_all(snd_emux_t *emu)
+snd_emux_terminate_all(struct snd_emux *emu)
 {
 	int i;
-	snd_emux_voice_t *vp;
+	struct snd_emux_voice *vp;
 	unsigned long flags;
 
 	spin_lock_irqsave(&emu->voice_lock, flags);
@@ -434,11 +438,11 @@
  * Terminate all voices associated with the given port
  */
 void
-snd_emux_sounds_off_all(snd_emux_port_t *port)
+snd_emux_sounds_off_all(struct snd_emux_port *port)
 {
 	int i;
-	snd_emux_t *emu;
-	snd_emux_voice_t *vp;
+	struct snd_emux *emu;
+	struct snd_emux_voice *vp;
 	unsigned long flags;
 
 	snd_assert(port != NULL, return);
@@ -468,9 +472,9 @@
  * is mainly for drums.
  */
 static void
-exclusive_note_off(snd_emux_t *emu, snd_emux_port_t *port, int exclass)
+exclusive_note_off(struct snd_emux *emu, struct snd_emux_port *port, int exclass)
 {
-	snd_emux_voice_t *vp;
+	struct snd_emux_voice *vp;
 	int  i;
 	unsigned long flags;
 
@@ -490,7 +494,7 @@
  * if free flag is true, call free_voice after termination
  */
 static void
-terminate_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int free)
+terminate_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int free)
 {
 	emu->ops.terminate(vp);
 	vp->time = emu->use_time++;
@@ -508,7 +512,7 @@
  * Modulate the voice
  */
 static void
-update_voice(snd_emux_t *emu, snd_emux_voice_t *vp, int update)
+update_voice(struct snd_emux *emu, struct snd_emux_voice *vp, int update)
 {
 	if (!STATE_IS_PLAYING(vp->state))
 		return;
@@ -543,9 +547,9 @@
  * will be needed later.
  */
 static void
-setup_voice(snd_emux_voice_t *vp)
+setup_voice(struct snd_emux_voice *vp)
 {
-	soundfont_voice_parm_t *parm;
+	struct soundfont_voice_parm *parm;
 	int pitch;
 
 	/* copy the original register values */
@@ -636,9 +640,9 @@
 };
 
 static int
-calc_pan(snd_emux_voice_t *vp)
+calc_pan(struct snd_emux_voice *vp)
 {
-	snd_midi_channel_t *chan = vp->chan;
+	struct snd_midi_channel *chan = vp->chan;
 	int pan;
 
 	/* pan & loop start (pan 8bit, MSB, 0:right, 0xff:left) */
@@ -737,12 +741,12 @@
  * voice and channels parameters.
  */
 static int
-calc_volume(snd_emux_voice_t *vp)
+calc_volume(struct snd_emux_voice *vp)
 {
 	int vol;
 	int main_vol, expression_vol, master_vol;
-	snd_midi_channel_t *chan = vp->chan;
-	snd_emux_port_t *port = vp->port;
+	struct snd_midi_channel *chan = vp->chan;
+	struct snd_emux_port *port = vp->port;
 
 	expression_vol = chan->control[MIDI_CTL_MSB_EXPRESSION];
 	LIMITMAX(vp->velocity, 127);
@@ -775,7 +779,7 @@
 
 #ifdef SNDRV_EMUX_USE_RAW_EFFECT
 	if (chan->private) {
-		snd_emux_effect_table_t *fx = chan->private;
+		struct snd_emux_effect_table *fx = chan->private;
 		vol += fx->val[EMUX_FX_ATTEN];
 	}
 #endif
@@ -808,9 +812,9 @@
  */
 
 static int
-calc_pitch(snd_emux_voice_t *vp)
+calc_pitch(struct snd_emux_voice *vp)
 {
-	snd_midi_channel_t *chan = vp->chan;
+	struct snd_midi_channel *chan = vp->chan;
 	int offset;
 
 	/* calculate offset */
@@ -837,7 +841,7 @@
 #ifdef SNDRV_EMUX_USE_RAW_EFFECT
 	/* add initial pitch correction */
 	if (chan->private) {
-		snd_emux_effect_table_t *fx = chan->private;
+		struct snd_emux_effect_table *fx = chan->private;
 		if (fx->flag[EMUX_FX_INIT_PITCH])
 			offset += fx->val[EMUX_FX_INIT_PITCH];
 	}
@@ -857,7 +861,7 @@
  * Get the bank number assigned to the channel
  */
 static int
-get_bank(snd_emux_port_t *port, snd_midi_channel_t *chan)
+get_bank(struct snd_emux_port *port, struct snd_midi_channel *chan)
 {
 	int val;
 
@@ -886,8 +890,9 @@
  * The resultant zones are stored on table.
  */
 static int
-get_zone(snd_emux_t *emu, snd_emux_port_t *port,
-	 int *notep, int vel, snd_midi_channel_t *chan, snd_sf_zone_t **table)
+get_zone(struct snd_emux *emu, struct snd_emux_port *port,
+	 int *notep, int vel, struct snd_midi_channel *chan,
+	 struct snd_sf_zone **table)
 {
 	int preset, bank, def_preset, def_bank;
 
@@ -910,9 +915,9 @@
 /*
  */
 void
-snd_emux_init_voices(snd_emux_t *emu)
+snd_emux_init_voices(struct snd_emux *emu)
 {
-	snd_emux_voice_t *vp;
+	struct snd_emux_voice *vp;
 	int i;
 	unsigned long flags;
 
@@ -932,7 +937,7 @@
 
 /*
  */
-void snd_emux_lock_voice(snd_emux_t *emu, int voice)
+void snd_emux_lock_voice(struct snd_emux *emu, int voice)
 {
 	unsigned long flags;
 
@@ -947,7 +952,7 @@
 
 /*
  */
-void snd_emux_unlock_voice(snd_emux_t *emu, int voice)
+void snd_emux_unlock_voice(struct snd_emux *emu, int voice)
 {
 	unsigned long flags;
 
diff --git a/sound/synth/emux/emux_voice.h b/sound/synth/emux/emux_voice.h
index 67eb553..0a56ca1 100644
--- a/sound/synth/emux/emux_voice.h
+++ b/sound/synth/emux/emux_voice.h
@@ -29,60 +29,69 @@
 #include <sound/emux_synth.h>
 
 /* Prototypes for emux_seq.c */
-int snd_emux_init_seq(snd_emux_t *emu, snd_card_t *card, int index);
-void snd_emux_detach_seq(snd_emux_t *emu);
-snd_emux_port_t *snd_emux_create_port(snd_emux_t *emu, char *name, int max_channels, int type, snd_seq_port_callback_t *callback);
-void snd_emux_reset_port(snd_emux_port_t *port);
-int snd_emux_event_input(snd_seq_event_t *ev, int direct, void *private, int atomic, int hop);
-int snd_emux_inc_count(snd_emux_t *emu);
-void snd_emux_dec_count(snd_emux_t *emu);
-int snd_emux_init_virmidi(snd_emux_t *emu, snd_card_t *card);
-int snd_emux_delete_virmidi(snd_emux_t *emu);
+int snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index);
+void snd_emux_detach_seq(struct snd_emux *emu);
+struct snd_emux_port *snd_emux_create_port(struct snd_emux *emu, char *name,
+					   int max_channels, int type,
+					   struct snd_seq_port_callback *callback);
+void snd_emux_reset_port(struct snd_emux_port *port);
+int snd_emux_event_input(struct snd_seq_event *ev, int direct, void *private,
+			 int atomic, int hop);
+int snd_emux_inc_count(struct snd_emux *emu);
+void snd_emux_dec_count(struct snd_emux *emu);
+int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card);
+int snd_emux_delete_virmidi(struct snd_emux *emu);
 
 /* Prototypes for emux_synth.c */
-void snd_emux_init_voices(snd_emux_t *emu);
+void snd_emux_init_voices(struct snd_emux *emu);
 
 void snd_emux_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
 void snd_emux_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
 void snd_emux_key_press(void *p, int note, int vel, struct snd_midi_channel *chan);
-void snd_emux_terminate_note(void *p, int note, snd_midi_channel_t *chan);
+void snd_emux_terminate_note(void *p, int note, struct snd_midi_channel *chan);
 void snd_emux_control(void *p, int type, struct snd_midi_channel *chan);
 
-void snd_emux_sounds_off_all(snd_emux_port_t *port);
-void snd_emux_update_channel(snd_emux_port_t *port, snd_midi_channel_t *chan, int update);
-void snd_emux_update_port(snd_emux_port_t *port, int update);
+void snd_emux_sounds_off_all(struct snd_emux_port *port);
+void snd_emux_update_channel(struct snd_emux_port *port,
+			     struct snd_midi_channel *chan, int update);
+void snd_emux_update_port(struct snd_emux_port *port, int update);
 
 void snd_emux_timer_callback(unsigned long data);
 
 /* emux_effect.c */
 #ifdef SNDRV_EMUX_USE_RAW_EFFECT
-void snd_emux_create_effect(snd_emux_port_t *p);
-void snd_emux_delete_effect(snd_emux_port_t *p);
-void snd_emux_clear_effect(snd_emux_port_t *p);
-void snd_emux_setup_effect(snd_emux_voice_t *vp);
-void snd_emux_send_effect_oss(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val);
-void snd_emux_send_effect(snd_emux_port_t *port, snd_midi_channel_t *chan, int type, int val, int mode);
+void snd_emux_create_effect(struct snd_emux_port *p);
+void snd_emux_delete_effect(struct snd_emux_port *p);
+void snd_emux_clear_effect(struct snd_emux_port *p);
+void snd_emux_setup_effect(struct snd_emux_voice *vp);
+void snd_emux_send_effect_oss(struct snd_emux_port *port,
+			      struct snd_midi_channel *chan, int type, int val);
+void snd_emux_send_effect(struct snd_emux_port *port,
+			  struct snd_midi_channel *chan, int type, int val, int mode);
 #endif
 
 /* emux_nrpn.c */
-void snd_emux_sysex(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset);
-int snd_emux_xg_control(snd_emux_port_t *port, snd_midi_channel_t *chan, int param);
-void snd_emux_nrpn(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset);
+void snd_emux_sysex(void *private_data, unsigned char *buf, int len,
+		    int parsed, struct snd_midi_channel_set *chset);
+int snd_emux_xg_control(struct snd_emux_port *port,
+			struct snd_midi_channel *chan, int param);
+void snd_emux_nrpn(void *private_data, struct snd_midi_channel *chan,
+		   struct snd_midi_channel_set *chset);
 
 /* emux_oss.c */
-void snd_emux_init_seq_oss(snd_emux_t *emu);
-void snd_emux_detach_seq_oss(snd_emux_t *emu);
+void snd_emux_init_seq_oss(struct snd_emux *emu);
+void snd_emux_detach_seq_oss(struct snd_emux *emu);
 
 /* emux_proc.c */
 #ifdef CONFIG_PROC_FS
-void snd_emux_proc_init(snd_emux_t *emu, snd_card_t *card, int device);
-void snd_emux_proc_free(snd_emux_t *emu);
+void snd_emux_proc_init(struct snd_emux *emu, struct snd_card *card, int device);
+void snd_emux_proc_free(struct snd_emux *emu);
 #endif
 
 #define STATE_IS_PLAYING(s) ((s) & SNDRV_EMUX_ST_ON)
 
 /* emux_hwdep.c */
-int snd_emux_init_hwdep(snd_emux_t *emu);
-void snd_emux_delete_hwdep(snd_emux_t *emu);
+int snd_emux_init_hwdep(struct snd_emux *emu);
+void snd_emux_delete_hwdep(struct snd_emux *emu);
 
 #endif
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index d0925ea..4c5754d 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -34,38 +34,49 @@
 
 /* Prototypes for static functions */
 
-static int open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client);
-static snd_soundfont_t *newsf(snd_sf_list_t *sflist, int type, char *name);
-static int is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name);
-static int close_patch(snd_sf_list_t *sflist);
-static int probe_data(snd_sf_list_t *sflist, int sample_id);
-static void set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp);
-static snd_sf_zone_t *sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf);
-static void set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp);
-static snd_sf_sample_t *sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf);
-static void sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp);
-static int load_map(snd_sf_list_t *sflist, const void __user *data, int count);
-static int load_info(snd_sf_list_t *sflist, const void __user *data, long count);
-static int remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr);
-static void init_voice_info(soundfont_voice_info_t *avp);
-static void init_voice_parm(soundfont_voice_parm_t *pp);
-static snd_sf_sample_t *set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp);
-static snd_sf_sample_t *find_sample(snd_soundfont_t *sf, int sample_id);
-static int load_data(snd_sf_list_t *sflist, const void __user *data, long count);
-static void rebuild_presets(snd_sf_list_t *sflist);
-static void add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur);
-static void delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp);
-static snd_sf_zone_t *search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key);
-static int search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level);
+static int open_patch(struct snd_sf_list *sflist, const char __user *data,
+		      int count, int client);
+static struct snd_soundfont *newsf(struct snd_sf_list *sflist, int type, char *name);
+static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name);
+static int close_patch(struct snd_sf_list *sflist);
+static int probe_data(struct snd_sf_list *sflist, int sample_id);
+static void set_zone_counter(struct snd_sf_list *sflist,
+			     struct snd_soundfont *sf, struct snd_sf_zone *zp);
+static struct snd_sf_zone *sf_zone_new(struct snd_sf_list *sflist,
+				       struct snd_soundfont *sf);
+static void set_sample_counter(struct snd_sf_list *sflist,
+			       struct snd_soundfont *sf, struct snd_sf_sample *sp);
+static struct snd_sf_sample *sf_sample_new(struct snd_sf_list *sflist,
+					   struct snd_soundfont *sf);
+static void sf_sample_delete(struct snd_sf_list *sflist,
+			     struct snd_soundfont *sf, struct snd_sf_sample *sp);
+static int load_map(struct snd_sf_list *sflist, const void __user *data, int count);
+static int load_info(struct snd_sf_list *sflist, const void __user *data, long count);
+static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+		       int bank, int instr);
+static void init_voice_info(struct soundfont_voice_info *avp);
+static void init_voice_parm(struct soundfont_voice_parm *pp);
+static struct snd_sf_sample *set_sample(struct snd_soundfont *sf,
+					struct soundfont_voice_info *avp);
+static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);
+static int load_data(struct snd_sf_list *sflist, const void __user *data, long count);
+static void rebuild_presets(struct snd_sf_list *sflist);
+static void add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur);
+static void delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp);
+static struct snd_sf_zone *search_first_zone(struct snd_sf_list *sflist,
+					     int bank, int preset, int key);
+static int search_zones(struct snd_sf_list *sflist, int *notep, int vel,
+			int preset, int bank, struct snd_sf_zone **table,
+			int max_layers, int level);
 static int get_index(int bank, int instr, int key);
-static void snd_sf_init(snd_sf_list_t *sflist);
-static void snd_sf_clear(snd_sf_list_t *sflist);
+static void snd_sf_init(struct snd_sf_list *sflist);
+static void snd_sf_clear(struct snd_sf_list *sflist);
 
 /*
  * lock access to sflist
  */
 static void
-lock_preset(snd_sf_list_t *sflist)
+lock_preset(struct snd_sf_list *sflist)
 {
 	unsigned long flags;
 	down(&sflist->presets_mutex);
@@ -79,7 +90,7 @@
  * remove lock
  */
 static void
-unlock_preset(snd_sf_list_t *sflist)
+unlock_preset(struct snd_sf_list *sflist)
 {
 	unsigned long flags;
 	spin_lock_irqsave(&sflist->lock, flags);
@@ -93,7 +104,7 @@
  * close the patch if the patch was opened by this client.
  */
 int
-snd_soundfont_close_check(snd_sf_list_t *sflist, int client)
+snd_soundfont_close_check(struct snd_sf_list *sflist, int client)
 {
 	unsigned long flags;
 	spin_lock_irqsave(&sflist->lock, flags);
@@ -115,9 +126,10 @@
  * it wants to do with it.
  */
 int
-snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client)
+snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
+		   long count, int client)
 {
-	soundfont_patch_info_t patch;
+	struct soundfont_patch_info patch;
 	unsigned long flags;
 	int  rc;
 
@@ -215,10 +227,11 @@
 
 /* open patch; create sf list */
 static int
-open_patch(snd_sf_list_t *sflist, const char __user *data, int count, int client)
+open_patch(struct snd_sf_list *sflist, const char __user *data,
+	   int count, int client)
 {
-	soundfont_open_parm_t parm;
-	snd_soundfont_t *sf;
+	struct soundfont_open_parm parm;
+	struct snd_soundfont *sf;
 	unsigned long flags;
 
 	spin_lock_irqsave(&sflist->lock, flags);
@@ -251,10 +264,10 @@
 /*
  * Allocate a new soundfont structure.
  */
-static snd_soundfont_t *
-newsf(snd_sf_list_t *sflist, int type, char *name)
+static struct snd_soundfont *
+newsf(struct snd_sf_list *sflist, int type, char *name)
 {
-	snd_soundfont_t *sf;
+	struct snd_soundfont *sf;
 
 	/* check the shared fonts */
 	if (type & SNDRV_SFNT_PAT_SHARED) {
@@ -287,7 +300,7 @@
 
 /* check if the given name matches to the existing list */
 static int
-is_identical_font(snd_soundfont_t *sf, int type, unsigned char *name)
+is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name)
 {
 	return ((sf->type & SNDRV_SFNT_PAT_SHARED) &&
 		(sf->type & 0x0f) == (type & 0x0f) &&
@@ -299,7 +312,7 @@
  * Close the current patch.
  */
 static int
-close_patch(snd_sf_list_t *sflist)
+close_patch(struct snd_sf_list *sflist)
 {
 	unsigned long flags;
 
@@ -316,7 +329,7 @@
 
 /* probe sample in the current list -- nothing to be loaded */
 static int
-probe_data(snd_sf_list_t *sflist, int sample_id)
+probe_data(struct snd_sf_list *sflist, int sample_id)
 {
 	/* patch must be opened */
 	if (sflist->currsf) {
@@ -331,7 +344,8 @@
  * increment zone counter
  */
 static void
-set_zone_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_zone_t *zp)
+set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+		 struct snd_sf_zone *zp)
 {
 	zp->counter = sflist->zone_counter++;
 	if (sf->type & SNDRV_SFNT_PAT_LOCKED)
@@ -341,10 +355,10 @@
 /*
  * allocate a new zone record
  */
-static snd_sf_zone_t *
-sf_zone_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
+static struct snd_sf_zone *
+sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
 {
-	snd_sf_zone_t *zp;
+	struct snd_sf_zone *zp;
 
 	if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL)
 		return NULL;
@@ -362,7 +376,8 @@
  * increment sample couter
  */
 static void
-set_sample_counter(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp)
+set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+		   struct snd_sf_sample *sp)
 {
 	sp->counter = sflist->sample_counter++;
 	if (sf->type & SNDRV_SFNT_PAT_LOCKED)
@@ -372,10 +387,10 @@
 /*
  * allocate a new sample list record
  */
-static snd_sf_sample_t *
-sf_sample_new(snd_sf_list_t *sflist, snd_soundfont_t *sf)
+static struct snd_sf_sample *
+sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
 {
-	snd_sf_sample_t *sp;
+	struct snd_sf_sample *sp;
 
 	if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL)
 		return NULL;
@@ -392,7 +407,8 @@
  * only the last allocated sample can be deleted.
  */
 static void
-sf_sample_delete(snd_sf_list_t *sflist, snd_soundfont_t *sf, snd_sf_sample_t *sp)
+sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+		 struct snd_sf_sample *sp)
 {
 	/* only last sample is accepted */
 	if (sp == sf->samples) {
@@ -404,11 +420,11 @@
 
 /* load voice map */
 static int
-load_map(snd_sf_list_t *sflist, const void __user *data, int count)
+load_map(struct snd_sf_list *sflist, const void __user *data, int count)
 {
-	snd_sf_zone_t *zp, *prevp;
-	snd_soundfont_t *sf;
-	soundfont_voice_map_t map;
+	struct snd_sf_zone *zp, *prevp;
+	struct snd_soundfont *sf;
+	struct soundfont_voice_map map;
 
 	/* get the link info */
 	if (count < (int)sizeof(map))
@@ -469,9 +485,10 @@
 
 /* remove the present instrument layers */
 static int
-remove_info(snd_sf_list_t *sflist, snd_soundfont_t *sf, int bank, int instr)
+remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
+	    int bank, int instr)
 {
-	snd_sf_zone_t *prev, *next, *p;
+	struct snd_sf_zone *prev, *next, *p;
 	int removed = 0;
 
 	prev = NULL;
@@ -500,11 +517,11 @@
  * open soundfont.
  */
 static int
-load_info(snd_sf_list_t *sflist, const void __user *data, long count)
+load_info(struct snd_sf_list *sflist, const void __user *data, long count)
 {
-	snd_soundfont_t *sf;
-	snd_sf_zone_t *zone;
-	soundfont_voice_rec_hdr_t hdr;
+	struct snd_soundfont *sf;
+	struct snd_sf_zone *zone;
+	struct soundfont_voice_rec_hdr hdr;
 	int i;
 
 	/* patch must be opened */
@@ -529,7 +546,7 @@
 		return -EINVAL;
 	}
 
-	if (count < (long)sizeof(soundfont_voice_info_t)*hdr.nvoices) {
+	if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {
 		printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n",
 		       count, hdr.nvoices);
 		return -EINVAL;
@@ -553,7 +570,7 @@
 	}
 
 	for (i = 0; i < hdr.nvoices; i++) {
-		snd_sf_zone_t tmpzone;
+		struct snd_sf_zone tmpzone;
 
 		/* copy awe_voice_info parameters */
 		if (copy_from_user(&tmpzone.v, data, sizeof(tmpzone.v))) {
@@ -590,7 +607,7 @@
 
 /* initialize voice_info record */
 static void
-init_voice_info(soundfont_voice_info_t *avp)
+init_voice_info(struct soundfont_voice_info *avp)
 {
 	memset(avp, 0, sizeof(*avp));
 
@@ -614,7 +631,7 @@
  * Chorus and Reverb effects are zero.
  */
 static void
-init_voice_parm(soundfont_voice_parm_t *pp)
+init_voice_parm(struct soundfont_voice_parm *pp)
 {
 	memset(pp, 0, sizeof(*pp));
 
@@ -635,10 +652,10 @@
 }	
 
 /* search the specified sample */
-static snd_sf_sample_t *
-set_sample(snd_soundfont_t *sf, soundfont_voice_info_t *avp)
+static struct snd_sf_sample *
+set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp)
 {
-	snd_sf_sample_t *sample;
+	struct snd_sf_sample *sample;
 
 	sample = find_sample(sf, avp->sample);
 	if (sample == NULL)
@@ -661,10 +678,10 @@
 }
 
 /* find the sample pointer with the given id in the soundfont */
-static snd_sf_sample_t *
-find_sample(snd_soundfont_t *sf, int sample_id)
+static struct snd_sf_sample *
+find_sample(struct snd_soundfont *sf, int sample_id)
 {
-	snd_sf_sample_t *p;
+	struct snd_sf_sample *p;
 
 	if (sf == NULL)
 		return NULL;
@@ -684,11 +701,11 @@
  * routine.
  */
 static int
-load_data(snd_sf_list_t *sflist, const void __user *data, long count)
+load_data(struct snd_sf_list *sflist, const void __user *data, long count)
 {
-	snd_soundfont_t *sf;
-	soundfont_sample_info_t sample_info;
-	snd_sf_sample_t *sp;
+	struct snd_soundfont *sf;
+	struct soundfont_sample_info sample_info;
+	struct snd_sf_sample *sp;
 	long off;
 
 	/* patch must be opened */
@@ -922,12 +939,13 @@
 
 /* load GUS patch */
 static int
-load_guspatch(snd_sf_list_t *sflist, const char __user *data, long count, int client)
+load_guspatch(struct snd_sf_list *sflist, const char __user *data,
+	      long count, int client)
 {
 	struct patch_info patch;
-	snd_soundfont_t *sf;
-	snd_sf_zone_t *zone;
-	snd_sf_sample_t *smp;
+	struct snd_soundfont *sf;
+	struct snd_sf_zone *zone;
+	struct snd_sf_sample *smp;
 	int note, sample_id;
 	int rc;
 
@@ -992,7 +1010,8 @@
 	 */
 	if (sflist->callback.sample_new) {
 		rc = sflist->callback.sample_new
-			(sflist->callback.private_data, smp, sflist->memhdr, data, count);
+			(sflist->callback.private_data, smp, sflist->memhdr,
+			 data, count);
 		if (rc < 0) {
 			sf_sample_delete(sflist, sf, smp);
 			return rc;
@@ -1095,7 +1114,7 @@
 
 /* load GUS patch */
 int
-snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data,
+snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
 			    long count, int client)
 {
 	int rc;
@@ -1114,10 +1133,10 @@
  * bank/key combination).
  */
 static void
-rebuild_presets(snd_sf_list_t *sflist)
+rebuild_presets(struct snd_sf_list *sflist)
 {
-	snd_soundfont_t *sf;
-	snd_sf_zone_t *cur;
+	struct snd_soundfont *sf;
+	struct snd_sf_zone *cur;
 
 	/* clear preset table */
 	memset(sflist->presets, 0, sizeof(sflist->presets));
@@ -1142,15 +1161,15 @@
  * add the given zone to preset table
  */
 static void
-add_preset(snd_sf_list_t *sflist, snd_sf_zone_t *cur)
+add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur)
 {
-	snd_sf_zone_t *zone;
+	struct snd_sf_zone *zone;
 	int index;
 
 	zone = search_first_zone(sflist, cur->bank, cur->instr, cur->v.low);
 	if (zone && zone->v.sf_id != cur->v.sf_id) {
 		/* different instrument was already defined */
-		snd_sf_zone_t *p;
+		struct snd_sf_zone *p;
 		/* compare the allocated time */
 		for (p = zone; p; p = p->next_zone) {
 			if (p->counter > cur->counter)
@@ -1174,10 +1193,10 @@
  * delete the given zones from preset_table
  */
 static void
-delete_preset(snd_sf_list_t *sflist, snd_sf_zone_t *zp)
+delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp)
 {
 	int index;
-	snd_sf_zone_t *p;
+	struct snd_sf_zone *p;
 
 	if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0)
 		return;
@@ -1200,10 +1219,10 @@
  * This function returns the number of found zones.  0 if not found.
  */
 int
-snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel,
+snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
 			  int preset, int bank,
 			  int def_preset, int def_bank,
-			  snd_sf_zone_t **table, int max_layers)
+			  struct snd_sf_zone **table, int max_layers)
 {
 	int nvoices;
 	unsigned long flags;
@@ -1217,10 +1236,13 @@
 		spin_unlock_irqrestore(&sflist->lock, flags);
 		return 0;
 	}
-	nvoices = search_zones(sflist, notep, vel, preset, bank, table, max_layers, 0);
+	nvoices = search_zones(sflist, notep, vel, preset, bank,
+			       table, max_layers, 0);
 	if (! nvoices) {
 		if (preset != def_preset || bank != def_bank)
-			nvoices = search_zones(sflist, notep, vel, def_preset, def_bank, table, max_layers, 0);
+			nvoices = search_zones(sflist, notep, vel,
+					       def_preset, def_bank,
+					       table, max_layers, 0);
 	}
 	spin_unlock_irqrestore(&sflist->lock, flags);
 	return nvoices;
@@ -1230,11 +1252,11 @@
 /*
  * search the first matching zone
  */
-static snd_sf_zone_t *
-search_first_zone(snd_sf_list_t *sflist, int bank, int preset, int key)
+static struct snd_sf_zone *
+search_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key)
 {
 	int index;
-	snd_sf_zone_t *zp;
+	struct snd_sf_zone *zp;
 
 	if ((index = get_index(bank, preset, key)) < 0)
 		return NULL;
@@ -1250,9 +1272,11 @@
  * search matching zones from sflist.  can be called recursively.
  */
 static int
-search_zones(snd_sf_list_t *sflist, int *notep, int vel, int preset, int bank, snd_sf_zone_t **table, int max_layers, int level)
+search_zones(struct snd_sf_list *sflist, int *notep, int vel,
+	     int preset, int bank, struct snd_sf_zone **table,
+	     int max_layers, int level)
 {
-	snd_sf_zone_t *zp;
+	struct snd_sf_zone *zp;
 	int nvoices;
 
 	zp = search_first_zone(sflist, bank, preset, *notep);
@@ -1310,7 +1334,7 @@
  * Initialise the sflist structure.
  */
 static void
-snd_sf_init(snd_sf_list_t *sflist)
+snd_sf_init(struct snd_sf_list *sflist)
 {
 	memset(sflist->presets, 0, sizeof(sflist->presets));
 
@@ -1329,11 +1353,11 @@
  * Release all list records
  */
 static void
-snd_sf_clear(snd_sf_list_t *sflist)
+snd_sf_clear(struct snd_sf_list *sflist)
 {
-	snd_soundfont_t *sf, *nextsf;
-	snd_sf_zone_t *zp, *nextzp;
-	snd_sf_sample_t *sp, *nextsp;
+	struct snd_soundfont *sf, *nextsf;
+	struct snd_sf_zone *zp, *nextzp;
+	struct snd_sf_sample *sp, *nextsp;
 
 	for (sf = sflist->fonts; sf; sf = nextsf) {
 		nextsf = sf->next;
@@ -1344,7 +1368,8 @@
 		for (sp = sf->samples; sp; sp = nextsp) {
 			nextsp = sp->next;
 			if (sflist->callback.sample_free)
-				sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr);
+				sflist->callback.sample_free(sflist->callback.private_data,
+							     sp, sflist->memhdr);
 			kfree(sp);
 		}
 		kfree(sf);
@@ -1357,10 +1382,10 @@
 /*
  * Create a new sflist structure
  */
-snd_sf_list_t *
-snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr)
+struct snd_sf_list *
+snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr)
 {
-	snd_sf_list_t *sflist;
+	struct snd_sf_list *sflist;
 
 	if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL)
 		return NULL;
@@ -1381,7 +1406,7 @@
  * Free everything allocated off the sflist structure.
  */
 void
-snd_sf_free(snd_sf_list_t *sflist)
+snd_sf_free(struct snd_sf_list *sflist)
 {
 	if (sflist == NULL)
 		return;
@@ -1400,7 +1425,7 @@
  * The soundcard should be silet before calling this function.
  */
 int
-snd_soundfont_remove_samples(snd_sf_list_t *sflist)
+snd_soundfont_remove_samples(struct snd_sf_list *sflist)
 {
 	lock_preset(sflist);
 	if (sflist->callback.sample_reset)
@@ -1416,11 +1441,11 @@
  * The soundcard should be silent before calling this function.
  */
 int
-snd_soundfont_remove_unlocked(snd_sf_list_t *sflist)
+snd_soundfont_remove_unlocked(struct snd_sf_list *sflist)
 {
-	snd_soundfont_t *sf;
-	snd_sf_zone_t *zp, *nextzp;
-	snd_sf_sample_t *sp, *nextsp;
+	struct snd_soundfont *sf;
+	struct snd_sf_zone *zp, *nextzp;
+	struct snd_sf_sample *sp, *nextsp;
 
 	lock_preset(sflist);
 
@@ -1446,7 +1471,8 @@
 			sf->samples = nextsp;
 			sflist->mem_used -= sp->v.truesize;
 			if (sflist->callback.sample_free)
-				sflist->callback.sample_free(sflist->callback.private_data, sp, sflist->memhdr);
+				sflist->callback.sample_free(sflist->callback.private_data,
+							     sp, sflist->memhdr);
 			kfree(sp);
 		}
 	}
diff --git a/sound/synth/util_mem.c b/sound/synth/util_mem.c
index 5f75bf3..217e8e5 100644
--- a/sound/synth/util_mem.c
+++ b/sound/synth/util_mem.c
@@ -28,15 +28,15 @@
 MODULE_DESCRIPTION("Generic memory management routines for soundcard memory allocation");
 MODULE_LICENSE("GPL");
 
-#define get_memblk(p)	list_entry(p, snd_util_memblk_t, list)
+#define get_memblk(p)	list_entry(p, struct snd_util_memblk, list)
 
 /*
  * create a new memory manager
  */
-snd_util_memhdr_t *
+struct snd_util_memhdr *
 snd_util_memhdr_new(int memsize)
 {
-	snd_util_memhdr_t *hdr;
+	struct snd_util_memhdr *hdr;
 
 	hdr = kzalloc(sizeof(*hdr), GFP_KERNEL);
 	if (hdr == NULL)
@@ -51,7 +51,7 @@
 /*
  * free a memory manager
  */
-void snd_util_memhdr_free(snd_util_memhdr_t *hdr)
+void snd_util_memhdr_free(struct snd_util_memhdr *hdr)
 {
 	struct list_head *p;
 
@@ -67,11 +67,11 @@
 /*
  * allocate a memory block (without mutex)
  */
-snd_util_memblk_t *
-__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size)
+struct snd_util_memblk *
+__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
 {
-	snd_util_memblk_t *blk;
-	snd_util_unit_t units, prev_offset;
+	struct snd_util_memblk *blk;
+	unsigned int units, prev_offset;
 	struct list_head *p;
 
 	snd_assert(hdr != NULL, return NULL);
@@ -104,20 +104,21 @@
  * create a new memory block with the given size
  * the block is linked next to prev
  */
-snd_util_memblk_t *
-__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units,
+struct snd_util_memblk *
+__snd_util_memblk_new(struct snd_util_memhdr *hdr, unsigned int units,
 		      struct list_head *prev)
 {
-	snd_util_memblk_t *blk;
+	struct snd_util_memblk *blk;
 
-	blk = kmalloc(sizeof(snd_util_memblk_t) + hdr->block_extra_size, GFP_KERNEL);
+	blk = kmalloc(sizeof(struct snd_util_memblk) + hdr->block_extra_size,
+		      GFP_KERNEL);
 	if (blk == NULL)
 		return NULL;
 
 	if (! prev || prev == &hdr->block)
 		blk->offset = 0;
 	else {
-		snd_util_memblk_t *p = get_memblk(prev);
+		struct snd_util_memblk *p = get_memblk(prev);
 		blk->offset = p->offset + p->size;
 	}
 	blk->size = units;
@@ -131,10 +132,10 @@
 /*
  * allocate a memory block (with mutex)
  */
-snd_util_memblk_t *
-snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size)
+struct snd_util_memblk *
+snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size)
 {
-	snd_util_memblk_t *blk;
+	struct snd_util_memblk *blk;
 	down(&hdr->block_mutex);
 	blk = __snd_util_mem_alloc(hdr, size);
 	up(&hdr->block_mutex);
@@ -147,7 +148,7 @@
  * (without mutex)
  */
 void
-__snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk)
+__snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
 {
 	list_del(&blk->list);
 	hdr->nblocks--;
@@ -158,7 +159,7 @@
 /*
  * free a memory block (with mutex)
  */
-int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk)
+int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk)
 {
 	snd_assert(hdr && blk, return -EINVAL);
 
@@ -171,7 +172,7 @@
 /*
  * return available memory size
  */
-int snd_util_mem_avail(snd_util_memhdr_t *hdr)
+int snd_util_mem_avail(struct snd_util_memhdr *hdr)
 {
 	unsigned int size;
 	down(&hdr->block_mutex);
