diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 3f9db51..9492a32 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -36,11 +36,6 @@
  *  Raw MIDI interface
  */
 
-typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t;
-typedef struct sndrv_rawmidi_info snd_rawmidi_info_t;
-typedef struct sndrv_rawmidi_params snd_rawmidi_params_t;
-typedef struct sndrv_rawmidi_status snd_rawmidi_status_t;
-
 #define SNDRV_RAWMIDI_DEVICES		8
 
 #define SNDRV_RAWMIDI_LFLG_OUTPUT	(1<<0)
@@ -49,23 +44,22 @@
 #define SNDRV_RAWMIDI_LFLG_APPEND	(1<<2)
 #define	SNDRV_RAWMIDI_LFLG_NOOPENLOCK	(1<<3)
 
-typedef struct _snd_rawmidi_runtime snd_rawmidi_runtime_t;
-typedef struct _snd_rawmidi_substream snd_rawmidi_substream_t;
-typedef struct _snd_rawmidi_str snd_rawmidi_str_t;
+struct snd_rawmidi;
+struct snd_rawmidi_substream;
 
-typedef struct _snd_rawmidi_ops {
-	int (*open) (snd_rawmidi_substream_t * substream);
-	int (*close) (snd_rawmidi_substream_t * substream);
-	void (*trigger) (snd_rawmidi_substream_t * substream, int up);
-	void (*drain) (snd_rawmidi_substream_t * substream);
-} snd_rawmidi_ops_t;
+struct snd_rawmidi_ops {
+	int (*open) (struct snd_rawmidi_substream * substream);
+	int (*close) (struct snd_rawmidi_substream * substream);
+	void (*trigger) (struct snd_rawmidi_substream * substream, int up);
+	void (*drain) (struct snd_rawmidi_substream * substream);
+};
 
-typedef struct _snd_rawmidi_global_ops {
-	int (*dev_register) (snd_rawmidi_t * rmidi);
-	int (*dev_unregister) (snd_rawmidi_t * rmidi);
-} snd_rawmidi_global_ops_t;
+struct snd_rawmidi_global_ops {
+	int (*dev_register) (struct snd_rawmidi * rmidi);
+	int (*dev_unregister) (struct snd_rawmidi * rmidi);
+};
 
-struct _snd_rawmidi_runtime {
+struct snd_rawmidi_runtime {
 	unsigned int drain: 1,	/* drain stage */
 		     oss: 1;	/* OSS compatible mode */
 	/* midi stream buffer */
@@ -80,15 +74,15 @@
 	spinlock_t lock;
 	wait_queue_head_t sleep;
 	/* event handler (new bytes, input only) */
-	void (*event)(snd_rawmidi_substream_t *substream);
+	void (*event)(struct snd_rawmidi_substream *substream);
 	/* defers calls to event [input] or ops->trigger [output] */
 	struct tasklet_struct tasklet;
 	/* private data */
 	void *private_data;
-	void (*private_free)(snd_rawmidi_substream_t *substream);
+	void (*private_free)(struct snd_rawmidi_substream *substream);
 };
 
-struct _snd_rawmidi_substream {
+struct snd_rawmidi_substream {
 	struct list_head list;		/* list of all substream for given stream */
 	int stream;			/* direction */
 	int number;			/* substream number */
@@ -97,28 +91,28 @@
 		     active_sensing: 1; /* send active sensing when close */
 	int use_count;			/* use counter (for output) */
 	size_t bytes;
-	snd_rawmidi_t *rmidi;
-	snd_rawmidi_str_t *pstr;
+	struct snd_rawmidi *rmidi;
+	struct snd_rawmidi_str *pstr;
 	char name[32];
-	snd_rawmidi_runtime_t *runtime;
+	struct snd_rawmidi_runtime *runtime;
 	/* hardware layer */
-	snd_rawmidi_ops_t *ops;
+	struct snd_rawmidi_ops *ops;
 };
 
-typedef struct _snd_rawmidi_file {
-	snd_rawmidi_t *rmidi;
-	snd_rawmidi_substream_t *input;
-	snd_rawmidi_substream_t *output;
-} snd_rawmidi_file_t;
+struct snd_rawmidi_file {
+	struct snd_rawmidi *rmidi;
+	struct snd_rawmidi_substream *input;
+	struct snd_rawmidi_substream *output;
+};
 
-struct _snd_rawmidi_str {
+struct snd_rawmidi_str {
 	unsigned int substream_count;
 	unsigned int substream_opened;
 	struct list_head substreams;
 };
 
-struct _snd_rawmidi {
-	snd_card_t *card;
+struct snd_rawmidi {
+	struct snd_card *card;
 
 	unsigned int device;		/* device number */
 	unsigned int info_flags;	/* SNDRV_RAWMIDI_INFO_XXXX */
@@ -129,52 +123,61 @@
 	int ossreg;
 #endif
 
-	snd_rawmidi_global_ops_t *ops;
+	struct snd_rawmidi_global_ops *ops;
 
-	snd_rawmidi_str_t streams[2];
+	struct snd_rawmidi_str streams[2];
 
 	void *private_data;
-	void (*private_free) (snd_rawmidi_t *rmidi);
+	void (*private_free) (struct snd_rawmidi *rmidi);
 
 	struct semaphore open_mutex;
 	wait_queue_head_t open_wait;
 
-	snd_info_entry_t *dev;
-	snd_info_entry_t *proc_entry;
+	struct snd_info_entry *dev;
+	struct snd_info_entry *proc_entry;
 
 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
-	snd_seq_device_t *seq_dev;
+	struct snd_seq_device *seq_dev;
 #endif
 };
 
 /* main rawmidi functions */
 
-int snd_rawmidi_new(snd_card_t * card, char *id, int device,
+int snd_rawmidi_new(struct snd_card *card, char *id, int device,
 		    int output_count, int input_count,
-		    snd_rawmidi_t ** rmidi);
-void snd_rawmidi_set_ops(snd_rawmidi_t * rmidi, int stream, snd_rawmidi_ops_t * ops);
+		    struct snd_rawmidi **rmidi);
+void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
+			 struct snd_rawmidi_ops *ops);
 
 /* callbacks */
 
-void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream);
-int snd_rawmidi_receive(snd_rawmidi_substream_t * substream, const unsigned char *buffer, int count);
-void snd_rawmidi_transmit_reset(snd_rawmidi_substream_t * substream);
-int snd_rawmidi_transmit_empty(snd_rawmidi_substream_t * substream);
-int snd_rawmidi_transmit_peek(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count);
-int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count);
-int snd_rawmidi_transmit(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count);
+void snd_rawmidi_receive_reset(struct snd_rawmidi_substream *substream);
+int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
+			const unsigned char *buffer, int count);
+void snd_rawmidi_transmit_reset(struct snd_rawmidi_substream *substream);
+int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
+int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
+			      unsigned char *buffer, int count);
+int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count);
+int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
+			 unsigned char *buffer, int count);
 
 /* main midi functions */
 
-int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info);
-int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode, snd_rawmidi_file_t * rfile);
-int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile);
-int snd_rawmidi_output_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params);
-int snd_rawmidi_input_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params);
-int snd_rawmidi_drop_output(snd_rawmidi_substream_t * substream);
-int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream);
-int snd_rawmidi_drain_input(snd_rawmidi_substream_t * substream);
-long snd_rawmidi_kernel_read(snd_rawmidi_substream_t * substream, unsigned char *buf, long count);
-long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count);
+int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info);
+int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode,
+			    struct snd_rawmidi_file *rfile);
+int snd_rawmidi_kernel_release(struct snd_rawmidi_file *rfile);
+int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
+			      struct snd_rawmidi_params *params);
+int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
+			     struct snd_rawmidi_params *params);
+int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream);
+int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream);
+int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream);
+long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
+			     unsigned char *buf, long count);
+long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
+			      const unsigned char *buf, long count);
 
 #endif /* __SOUND_RAWMIDI_H */
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c
index d033e61..ede0a60 100644
--- a/sound/core/rawmidi.c
+++ b/sound/core/rawmidi.c
@@ -50,13 +50,13 @@
 MODULE_PARM_DESC(amidi_map, "Raw MIDI device number assigned to 2nd OSS device.");
 #endif /* CONFIG_SND_OSSEMUL */
 
-static int snd_rawmidi_free(snd_rawmidi_t *rawmidi);
-static int snd_rawmidi_dev_free(snd_device_t *device);
-static int snd_rawmidi_dev_register(snd_device_t *device);
-static int snd_rawmidi_dev_disconnect(snd_device_t *device);
-static int snd_rawmidi_dev_unregister(snd_device_t *device);
+static int snd_rawmidi_free(struct snd_rawmidi *rawmidi);
+static int snd_rawmidi_dev_free(struct snd_device *device);
+static int snd_rawmidi_dev_register(struct snd_device *device);
+static int snd_rawmidi_dev_disconnect(struct snd_device *device);
+static int snd_rawmidi_dev_unregister(struct snd_device *device);
 
-static snd_rawmidi_t *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES];
+static struct snd_rawmidi *snd_rawmidi_devices[SNDRV_CARDS * SNDRV_RAWMIDI_DEVICES];
 
 static DECLARE_MUTEX(register_mutex);
 
@@ -72,34 +72,35 @@
 	}
 }
 
-static inline int snd_rawmidi_ready(snd_rawmidi_substream_t * substream)
+static inline int snd_rawmidi_ready(struct snd_rawmidi_substream *substream)
 {
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 	return runtime->avail >= runtime->avail_min;
 }
 
-static inline int snd_rawmidi_ready_append(snd_rawmidi_substream_t * substream, size_t count)
+static inline int snd_rawmidi_ready_append(struct snd_rawmidi_substream *substream,
+					   size_t count)
 {
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 	return runtime->avail >= runtime->avail_min &&
 	       (!substream->append || runtime->avail >= count);
 }
 
 static void snd_rawmidi_input_event_tasklet(unsigned long data)
 {
-	snd_rawmidi_substream_t *substream = (snd_rawmidi_substream_t *)data;
+	struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data;
 	substream->runtime->event(substream);
 }
 
 static void snd_rawmidi_output_trigger_tasklet(unsigned long data)
 {
-	snd_rawmidi_substream_t *substream = (snd_rawmidi_substream_t *)data;
+	struct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream *)data;
 	substream->ops->trigger(substream, 1);
 }
 
-static int snd_rawmidi_runtime_create(snd_rawmidi_substream_t * substream)
+static int snd_rawmidi_runtime_create(struct snd_rawmidi_substream *substream)
 {
-	snd_rawmidi_runtime_t *runtime;
+	struct snd_rawmidi_runtime *runtime;
 
 	if ((runtime = kzalloc(sizeof(*runtime), GFP_KERNEL)) == NULL)
 		return -ENOMEM;
@@ -129,9 +130,9 @@
 	return 0;
 }
 
-static int snd_rawmidi_runtime_free(snd_rawmidi_substream_t * substream)
+static int snd_rawmidi_runtime_free(struct snd_rawmidi_substream *substream)
 {
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	kfree(runtime->buffer);
 	kfree(runtime);
@@ -139,7 +140,7 @@
 	return 0;
 }
 
-static inline void snd_rawmidi_output_trigger(snd_rawmidi_substream_t * substream, int up)
+static inline void snd_rawmidi_output_trigger(struct snd_rawmidi_substream *substream,int up)
 {
 	if (up) {
 		tasklet_hi_schedule(&substream->runtime->tasklet);
@@ -149,17 +150,17 @@
 	}
 }
 
-static void snd_rawmidi_input_trigger(snd_rawmidi_substream_t * substream, int up)
+static void snd_rawmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
 {
 	substream->ops->trigger(substream, up);
 	if (!up && substream->runtime->event)
 		tasklet_kill(&substream->runtime->tasklet);
 }
 
-int snd_rawmidi_drop_output(snd_rawmidi_substream_t * substream)
+int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream)
 {
 	unsigned long flags;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	snd_rawmidi_output_trigger(substream, 0);
 	runtime->drain = 0;
@@ -170,11 +171,11 @@
 	return 0;
 }
 
-int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream)
+int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream)
 {
 	int err;
 	long timeout;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	err = 0;
 	runtime->drain = 1;
@@ -199,10 +200,10 @@
 	return err;
 }
 
-int snd_rawmidi_drain_input(snd_rawmidi_substream_t * substream)
+int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream)
 {
 	unsigned long flags;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	snd_rawmidi_input_trigger(substream, 0);
 	runtime->drain = 0;
@@ -214,12 +215,12 @@
 }
 
 int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice,
-			    int mode, snd_rawmidi_file_t * rfile)
+			    int mode, struct snd_rawmidi_file * rfile)
 {
-	snd_rawmidi_t *rmidi;
+	struct snd_rawmidi *rmidi;
 	struct list_head *list1, *list2;
-	snd_rawmidi_substream_t *sinput = NULL, *soutput = NULL;
-	snd_rawmidi_runtime_t *input = NULL, *output = NULL;
+	struct snd_rawmidi_substream *sinput = NULL, *soutput = NULL;
+	struct snd_rawmidi_runtime *input = NULL, *output = NULL;
 	int err;
 
 	if (rfile)
@@ -275,7 +276,7 @@
 			}
 			break;
 		}
-		sinput = list_entry(list1, snd_rawmidi_substream_t, list);
+		sinput = list_entry(list1, struct snd_rawmidi_substream, list);
 		if ((mode & SNDRV_RAWMIDI_LFLG_INPUT) && sinput->opened)
 			goto __nexti;
 		if (subdevice < 0 || (subdevice >= 0 && subdevice == sinput->number))
@@ -293,7 +294,7 @@
 			}
 			break;
 		}
-		soutput = list_entry(list2, snd_rawmidi_substream_t, list);
+		soutput = list_entry(list2, struct snd_rawmidi_substream, list);
 		if (mode & SNDRV_RAWMIDI_LFLG_OUTPUT) {
 			if (mode & SNDRV_RAWMIDI_LFLG_APPEND) {
 				if (soutput->opened && !soutput->append)
@@ -368,15 +369,15 @@
 {
 	int maj = imajor(inode);
 	int cardnum;
-	snd_card_t *card;
+	struct snd_card *card;
 	int device, subdevice;
 	unsigned short fflags;
 	int err;
-	snd_rawmidi_t *rmidi;
-	snd_rawmidi_file_t *rawmidi_file;
+	struct snd_rawmidi *rmidi;
+	struct snd_rawmidi_file *rawmidi_file;
 	wait_queue_t wait;
 	struct list_head *list;
-	snd_ctl_file_t *kctl;
+	struct snd_ctl_file *kctl;
 
 	if (maj == snd_major) {
 		cardnum = SNDRV_MINOR_CARD(iminor(inode));
@@ -465,11 +466,11 @@
 	return err;
 }
 
-int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile)
+int snd_rawmidi_kernel_release(struct snd_rawmidi_file * rfile)
 {
-	snd_rawmidi_t *rmidi;
-	snd_rawmidi_substream_t *substream;
-	snd_rawmidi_runtime_t *runtime;
+	struct snd_rawmidi *rmidi;
+	struct snd_rawmidi_substream *substream;
+	struct snd_rawmidi_runtime *runtime;
 
 	snd_assert(rfile != NULL, return -ENXIO);
 	snd_assert(rfile->input != NULL || rfile->output != NULL, return -ENXIO);
@@ -515,8 +516,8 @@
 
 static int snd_rawmidi_release(struct inode *inode, struct file *file)
 {
-	snd_rawmidi_file_t *rfile;
-	snd_rawmidi_t *rmidi;
+	struct snd_rawmidi_file *rfile;
+	struct snd_rawmidi *rmidi;
 	int err;
 
 	rfile = file->private_data;
@@ -528,9 +529,10 @@
 	return err;
 }
 
-int snd_rawmidi_info(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t *info)
+int snd_rawmidi_info(struct snd_rawmidi_substream *substream,
+		     struct snd_rawmidi_info *info)
 {
-	snd_rawmidi_t *rmidi;
+	struct snd_rawmidi *rmidi;
 	
 	if (substream == NULL)
 		return -ENODEV;
@@ -550,22 +552,23 @@
 	return 0;
 }
 
-static int snd_rawmidi_info_user(snd_rawmidi_substream_t *substream, snd_rawmidi_info_t __user * _info)
+static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream,
+				 struct snd_rawmidi_info __user * _info)
 {
-	snd_rawmidi_info_t info;
+	struct snd_rawmidi_info info;
 	int err;
 	if ((err = snd_rawmidi_info(substream, &info)) < 0)
 		return err;
-	if (copy_to_user(_info, &info, sizeof(snd_rawmidi_info_t)))
+	if (copy_to_user(_info, &info, sizeof(struct snd_rawmidi_info)))
 		return -EFAULT;
 	return 0;
 }
 
-int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info)
+int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info)
 {
-	snd_rawmidi_t *rmidi;
-	snd_rawmidi_str_t *pstr;
-	snd_rawmidi_substream_t *substream;
+	struct snd_rawmidi *rmidi;
+	struct snd_rawmidi_str *pstr;
+	struct snd_rawmidi_substream *substream;
 	struct list_head *list;
 	if (info->device >= SNDRV_RAWMIDI_DEVICES)
 		return -ENXIO;
@@ -578,18 +581,18 @@
 	if (info->subdevice >= pstr->substream_count)
 		return -ENXIO;
 	list_for_each(list, &pstr->substreams) {
-		substream = list_entry(list, snd_rawmidi_substream_t, list);
+		substream = list_entry(list, struct snd_rawmidi_substream, list);
 		if ((unsigned int)substream->number == info->subdevice)
 			return snd_rawmidi_info(substream, info);
 	}
 	return -ENXIO;
 }
 
-static int snd_rawmidi_info_select_user(snd_card_t *card,
-					snd_rawmidi_info_t __user *_info)
+static int snd_rawmidi_info_select_user(struct snd_card *card,
+					struct snd_rawmidi_info __user *_info)
 {
 	int err;
-	snd_rawmidi_info_t info;
+	struct snd_rawmidi_info info;
 	if (get_user(info.device, &_info->device))
 		return -EFAULT;
 	if (get_user(info.stream, &_info->stream))
@@ -598,16 +601,16 @@
 		return -EFAULT;
 	if ((err = snd_rawmidi_info_select(card, &info)) < 0)
 		return err;
-	if (copy_to_user(_info, &info, sizeof(snd_rawmidi_info_t)))
+	if (copy_to_user(_info, &info, sizeof(struct snd_rawmidi_info)))
 		return -EFAULT;
 	return 0;
 }
 
-int snd_rawmidi_output_params(snd_rawmidi_substream_t * substream,
-			      snd_rawmidi_params_t * params)
+int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
+			      struct snd_rawmidi_params * params)
 {
 	char *newbuf;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 	
 	if (substream->append && substream->use_count > 1)
 		return -EBUSY;
@@ -630,11 +633,11 @@
 	return 0;
 }
 
-int snd_rawmidi_input_params(snd_rawmidi_substream_t * substream,
-			     snd_rawmidi_params_t * params)
+int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
+			     struct snd_rawmidi_params * params)
 {
 	char *newbuf;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	snd_rawmidi_drain_input(substream);
 	if (params->buffer_size < 32 || params->buffer_size > 1024L * 1024L) {
@@ -654,10 +657,10 @@
 	return 0;
 }
 
-static int snd_rawmidi_output_status(snd_rawmidi_substream_t * substream,
-				     snd_rawmidi_status_t * status)
+static int snd_rawmidi_output_status(struct snd_rawmidi_substream *substream,
+				     struct snd_rawmidi_status * status)
 {
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	memset(status, 0, sizeof(*status));
 	status->stream = SNDRV_RAWMIDI_STREAM_OUTPUT;
@@ -667,10 +670,10 @@
 	return 0;
 }
 
-static int snd_rawmidi_input_status(snd_rawmidi_substream_t * substream,
-				    snd_rawmidi_status_t * status)
+static int snd_rawmidi_input_status(struct snd_rawmidi_substream *substream,
+				    struct snd_rawmidi_status * status)
 {
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	memset(status, 0, sizeof(*status));
 	status->stream = SNDRV_RAWMIDI_STREAM_INPUT;
@@ -684,7 +687,7 @@
 
 static long snd_rawmidi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	snd_rawmidi_file_t *rfile;
+	struct snd_rawmidi_file *rfile;
 	void __user *argp = (void __user *)arg;
 
 	rfile = file->private_data;
@@ -695,8 +698,8 @@
 		return put_user(SNDRV_RAWMIDI_VERSION, (int __user *)argp) ? -EFAULT : 0;
 	case SNDRV_RAWMIDI_IOCTL_INFO:
 	{
-		snd_rawmidi_stream_t stream;
-		snd_rawmidi_info_t __user *info = argp;
+		int stream;
+		struct snd_rawmidi_info __user *info = argp;
 		if (get_user(stream, &info->stream))
 			return -EFAULT;
 		switch (stream) {
@@ -710,8 +713,8 @@
 	}
 	case SNDRV_RAWMIDI_IOCTL_PARAMS:
 	{
-		snd_rawmidi_params_t params;
-		if (copy_from_user(&params, argp, sizeof(snd_rawmidi_params_t)))
+		struct snd_rawmidi_params params;
+		if (copy_from_user(&params, argp, sizeof(struct snd_rawmidi_params)))
 			return -EFAULT;
 		switch (params.stream) {
 		case SNDRV_RAWMIDI_STREAM_OUTPUT:
@@ -729,8 +732,8 @@
 	case SNDRV_RAWMIDI_IOCTL_STATUS:
 	{
 		int err = 0;
-		snd_rawmidi_status_t status;
-		if (copy_from_user(&status, argp, sizeof(snd_rawmidi_status_t)))
+		struct snd_rawmidi_status status;
+		if (copy_from_user(&status, argp, sizeof(struct snd_rawmidi_status)))
 			return -EFAULT;
 		switch (status.stream) {
 		case SNDRV_RAWMIDI_STREAM_OUTPUT:
@@ -748,7 +751,7 @@
 		}
 		if (err < 0)
 			return err;
-		if (copy_to_user(argp, &status, sizeof(snd_rawmidi_status_t)))
+		if (copy_to_user(argp, &status, sizeof(struct snd_rawmidi_status)))
 			return -EFAULT;
 		return 0;
 	}
@@ -792,8 +795,8 @@
 	return -ENOTTY;
 }
 
-static int snd_rawmidi_control_ioctl(snd_card_t * card,
-				     snd_ctl_file_t * control,
+static int snd_rawmidi_control_ioctl(struct snd_card *card,
+				     struct snd_ctl_file *control,
 				     unsigned int cmd,
 				     unsigned long arg)
 {
@@ -845,11 +848,12 @@
  *
  * Returns the size of read data, or a negative error code on failure.
  */
-int snd_rawmidi_receive(snd_rawmidi_substream_t * substream, const unsigned char *buffer, int count)
+int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
+			const unsigned char *buffer, int count)
 {
 	unsigned long flags;
 	int result = 0, count1;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	if (runtime->buffer == NULL) {
 		snd_printd("snd_rawmidi_receive: input is not active!!!\n");
@@ -904,12 +908,12 @@
 	return result;
 }
 
-static long snd_rawmidi_kernel_read1(snd_rawmidi_substream_t *substream,
+static long snd_rawmidi_kernel_read1(struct snd_rawmidi_substream *substream,
 				     unsigned char *buf, long count, int kernel)
 {
 	unsigned long flags;
 	long result = 0, count1;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	while (count > 0 && runtime->avail) {
 		count1 = runtime->buffer_size - runtime->appl_ptr;
@@ -938,19 +942,21 @@
 	return result;
 }
 
-long snd_rawmidi_kernel_read(snd_rawmidi_substream_t *substream, unsigned char *buf, long count)
+long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
+			     unsigned char *buf, long count)
 {
 	snd_rawmidi_input_trigger(substream, 1);
 	return snd_rawmidi_kernel_read1(substream, buf, count, 1);
 }
 
-static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
+static ssize_t snd_rawmidi_read(struct file *file, char __user *buf, size_t count,
+				loff_t *offset)
 {
 	long result;
 	int count1;
-	snd_rawmidi_file_t *rfile;
-	snd_rawmidi_substream_t *substream;
-	snd_rawmidi_runtime_t *runtime;
+	struct snd_rawmidi_file *rfile;
+	struct snd_rawmidi_substream *substream;
+	struct snd_rawmidi_runtime *runtime;
 
 	rfile = file->private_data;
 	substream = rfile->input;
@@ -998,9 +1004,9 @@
  * 
  * Returns 1 if the internal output buffer is empty, 0 if not.
  */
-int snd_rawmidi_transmit_empty(snd_rawmidi_substream_t * substream)
+int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream)
 {
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 	int result;
 	unsigned long flags;
 
@@ -1028,11 +1034,12 @@
  *
  * Returns the size of copied data, or a negative error code on failure.
  */
-int snd_rawmidi_transmit_peek(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count)
+int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
+			      unsigned char *buffer, int count)
 {
 	unsigned long flags;
 	int result, count1;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	if (runtime->buffer == NULL) {
 		snd_printd("snd_rawmidi_transmit_peek: output is not active!!!\n");
@@ -1079,10 +1086,10 @@
  *
  * Returns the advanced size if successful, or a negative error code on failure.
  */
-int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count)
+int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count)
 {
 	unsigned long flags;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	if (runtime->buffer == NULL) {
 		snd_printd("snd_rawmidi_transmit_ack: output is not active!!!\n");
@@ -1112,7 +1119,8 @@
  *
  * Returns the copied size if successful, or a negative error code on failure.
  */
-int snd_rawmidi_transmit(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count)
+int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
+			 unsigned char *buffer, int count)
 {
 	count = snd_rawmidi_transmit_peek(substream, buffer, count);
 	if (count < 0)
@@ -1120,11 +1128,12 @@
 	return snd_rawmidi_transmit_ack(substream, count);
 }
 
-static long snd_rawmidi_kernel_write1(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count, int kernel)
+static long snd_rawmidi_kernel_write1(struct snd_rawmidi_substream *substream,
+				      const unsigned char *buf, long count, int kernel)
 {
 	unsigned long flags;
 	long count1, result;
-	snd_rawmidi_runtime_t *runtime = substream->runtime;
+	struct snd_rawmidi_runtime *runtime = substream->runtime;
 
 	snd_assert(buf != NULL, return -EINVAL);
 	snd_assert(runtime->buffer != NULL, return -EINVAL);
@@ -1170,18 +1179,20 @@
 	return result;
 }
 
-long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count)
+long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
+			      const unsigned char *buf, long count)
 {
 	return snd_rawmidi_kernel_write1(substream, buf, count, 1);
 }
 
-static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf, size_t count, loff_t *offset)
+static ssize_t snd_rawmidi_write(struct file *file, const char __user *buf,
+				 size_t count, loff_t *offset)
 {
 	long result, timeout;
 	int count1;
-	snd_rawmidi_file_t *rfile;
-	snd_rawmidi_runtime_t *runtime;
-	snd_rawmidi_substream_t *substream;
+	struct snd_rawmidi_file *rfile;
+	struct snd_rawmidi_runtime *runtime;
+	struct snd_rawmidi_substream *substream;
 
 	rfile = file->private_data;
 	substream = rfile->output;
@@ -1246,8 +1257,8 @@
 
 static unsigned int snd_rawmidi_poll(struct file *file, poll_table * wait)
 {
-	snd_rawmidi_file_t *rfile;
-	snd_rawmidi_runtime_t *runtime;
+	struct snd_rawmidi_file *rfile;
+	struct snd_rawmidi_runtime *runtime;
 	unsigned int mask;
 
 	rfile = file->private_data;
@@ -1284,12 +1295,12 @@
 
  */
 
-static void snd_rawmidi_proc_info_read(snd_info_entry_t *entry,
-				       snd_info_buffer_t * buffer)
+static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry,
+				       struct snd_info_buffer *buffer)
 {
-	snd_rawmidi_t *rmidi;
-	snd_rawmidi_substream_t *substream;
-	snd_rawmidi_runtime_t *runtime;
+	struct snd_rawmidi *rmidi;
+	struct snd_rawmidi_substream *substream;
+	struct snd_rawmidi_runtime *runtime;
 	struct list_head *list;
 
 	rmidi = entry->private_data;
@@ -1297,7 +1308,7 @@
 	down(&rmidi->open_mutex);
 	if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_OUTPUT) {
 		list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
-			substream = list_entry(list, snd_rawmidi_substream_t, list);
+			substream = list_entry(list, struct snd_rawmidi_substream, list);
 			snd_iprintf(buffer,
 				    "Output %d\n"
 				    "  Tx bytes     : %lu\n",
@@ -1317,7 +1328,7 @@
 	}
 	if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_INPUT) {
 		list_for_each(list, &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) {
-			substream = list_entry(list, snd_rawmidi_substream_t, list);
+			substream = list_entry(list, struct snd_rawmidi_substream, list);
 			snd_iprintf(buffer,
 				    "Input %d\n"
 				    "  Rx bytes     : %lu\n",
@@ -1354,18 +1365,18 @@
 	.compat_ioctl =	snd_rawmidi_ioctl_compat,
 };
 
-static snd_minor_t snd_rawmidi_reg =
+static struct snd_minor snd_rawmidi_reg =
 {
 	.comment =	"raw midi",
 	.f_ops =	&snd_rawmidi_f_ops,
 };
 
-static int snd_rawmidi_alloc_substreams(snd_rawmidi_t *rmidi,
-					snd_rawmidi_str_t *stream,
+static int snd_rawmidi_alloc_substreams(struct snd_rawmidi *rmidi,
+					struct snd_rawmidi_str *stream,
 					int direction,
 					int count)
 {
-	snd_rawmidi_substream_t *substream;
+	struct snd_rawmidi_substream *substream;
 	int idx;
 
 	INIT_LIST_HEAD(&stream->substreams);
@@ -1397,13 +1408,13 @@
  *
  * Returns zero if successful, or a negative error code on failure.
  */
-int snd_rawmidi_new(snd_card_t * card, char *id, int device,
+int snd_rawmidi_new(struct snd_card *card, char *id, int device,
 		    int output_count, int input_count,
-		    snd_rawmidi_t ** rrawmidi)
+		    struct snd_rawmidi ** rrawmidi)
 {
-	snd_rawmidi_t *rmidi;
+	struct snd_rawmidi *rmidi;
 	int err;
-	static snd_device_ops_t ops = {
+	static struct snd_device_ops ops = {
 		.dev_free = snd_rawmidi_dev_free,
 		.dev_register = snd_rawmidi_dev_register,
 		.dev_disconnect = snd_rawmidi_dev_disconnect,
@@ -1438,18 +1449,18 @@
 	return 0;
 }
 
-static void snd_rawmidi_free_substreams(snd_rawmidi_str_t *stream)
+static void snd_rawmidi_free_substreams(struct snd_rawmidi_str *stream)
 {
-	snd_rawmidi_substream_t *substream;
+	struct snd_rawmidi_substream *substream;
 
 	while (!list_empty(&stream->substreams)) {
-		substream = list_entry(stream->substreams.next, snd_rawmidi_substream_t, list);
+		substream = list_entry(stream->substreams.next, struct snd_rawmidi_substream, list);
 		list_del(&substream->list);
 		kfree(substream);
 	}
 }
 
-static int snd_rawmidi_free(snd_rawmidi_t *rmidi)
+static int snd_rawmidi_free(struct snd_rawmidi *rmidi)
 {
 	snd_assert(rmidi != NULL, return -ENXIO);	
 	snd_rawmidi_free_substreams(&rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT]);
@@ -1460,26 +1471,26 @@
 	return 0;
 }
 
-static int snd_rawmidi_dev_free(snd_device_t *device)
+static int snd_rawmidi_dev_free(struct snd_device *device)
 {
-	snd_rawmidi_t *rmidi = device->device_data;
+	struct snd_rawmidi *rmidi = device->device_data;
 	return snd_rawmidi_free(rmidi);
 }
 
 #if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
-static void snd_rawmidi_dev_seq_free(snd_seq_device_t *device)
+static void snd_rawmidi_dev_seq_free(struct snd_seq_device *device)
 {
-	snd_rawmidi_t *rmidi = device->private_data;
+	struct snd_rawmidi *rmidi = device->private_data;
 	rmidi->seq_dev = NULL;
 }
 #endif
 
-static int snd_rawmidi_dev_register(snd_device_t *device)
+static int snd_rawmidi_dev_register(struct snd_device *device)
 {
 	int idx, err;
-	snd_info_entry_t *entry;
+	struct snd_info_entry *entry;
 	char name[16];
-	snd_rawmidi_t *rmidi = device->device_data;
+	struct snd_rawmidi *rmidi = device->device_data;
 
 	if (rmidi->device >= SNDRV_RAWMIDI_DEVICES)
 		return -ENOMEM;
@@ -1554,9 +1565,9 @@
 	return 0;
 }
 
-static int snd_rawmidi_dev_disconnect(snd_device_t *device)
+static int snd_rawmidi_dev_disconnect(struct snd_device *device)
 {
-	snd_rawmidi_t *rmidi = device->device_data;
+	struct snd_rawmidi *rmidi = device->device_data;
 	int idx;
 
 	down(&register_mutex);
@@ -1566,10 +1577,10 @@
 	return 0;
 }
 
-static int snd_rawmidi_dev_unregister(snd_device_t *device)
+static int snd_rawmidi_dev_unregister(struct snd_device *device)
 {
 	int idx;
-	snd_rawmidi_t *rmidi = device->device_data;
+	struct snd_rawmidi *rmidi = device->device_data;
 
 	snd_assert(rmidi != NULL, return -ENXIO);
 	down(&register_mutex);
@@ -1613,13 +1624,14 @@
  *
  * Sets the rawmidi operators for the given stream direction.
  */
-void snd_rawmidi_set_ops(snd_rawmidi_t *rmidi, int stream, snd_rawmidi_ops_t *ops)
+void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
+			 struct snd_rawmidi_ops *ops)
 {
 	struct list_head *list;
-	snd_rawmidi_substream_t *substream;
+	struct snd_rawmidi_substream *substream;
 	
 	list_for_each(list, &rmidi->streams[stream].substreams) {
-		substream = list_entry(list, snd_rawmidi_substream_t, list);
+		substream = list_entry(list, struct snd_rawmidi_substream, list);
 		substream->ops = ops;
 	}
 }
diff --git a/sound/core/rawmidi_compat.c b/sound/core/rawmidi_compat.c
index d97631c..5268c1f 100644
--- a/sound/core/rawmidi_compat.c
+++ b/sound/core/rawmidi_compat.c
@@ -22,7 +22,7 @@
 
 #include <linux/compat.h>
 
-struct sndrv_rawmidi_params32 {
+struct snd_rawmidi_params32 {
 	s32 stream;
 	u32 buffer_size;
 	u32 avail_min;
@@ -30,10 +30,10 @@
 	unsigned char reserved[16];
 } __attribute__((packed));
 
-static int snd_rawmidi_ioctl_params_compat(snd_rawmidi_file_t *rfile,
-					   struct sndrv_rawmidi_params32 __user *src)
+static int snd_rawmidi_ioctl_params_compat(struct snd_rawmidi_file *rfile,
+					   struct snd_rawmidi_params32 __user *src)
 {
-	snd_rawmidi_params_t params;
+	struct snd_rawmidi_params params;
 	unsigned int val;
 
 	if (rfile->output == NULL)
@@ -53,7 +53,7 @@
 	return -EINVAL;
 }
 
-struct sndrv_rawmidi_status32 {
+struct snd_rawmidi_status32 {
 	s32 stream;
 	struct compat_timespec tstamp;
 	u32 avail;
@@ -61,11 +61,11 @@
 	unsigned char reserved[16];
 } __attribute__((packed));
 
-static int snd_rawmidi_ioctl_status_compat(snd_rawmidi_file_t *rfile,
-					   struct sndrv_rawmidi_status32 __user *src)
+static int snd_rawmidi_ioctl_status_compat(struct snd_rawmidi_file *rfile,
+					   struct snd_rawmidi_status32 __user *src)
 {
 	int err;
-	snd_rawmidi_status_t status;
+	struct snd_rawmidi_status status;
 
 	if (rfile->output == NULL)
 		return -EINVAL;
@@ -95,13 +95,13 @@
 }
 
 enum {
-	SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct sndrv_rawmidi_params32),
-	SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct sndrv_rawmidi_status32),
+	SNDRV_RAWMIDI_IOCTL_PARAMS32 = _IOWR('W', 0x10, struct snd_rawmidi_params32),
+	SNDRV_RAWMIDI_IOCTL_STATUS32 = _IOWR('W', 0x20, struct snd_rawmidi_status32),
 };
 
 static long snd_rawmidi_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	snd_rawmidi_file_t *rfile;
+	struct snd_rawmidi_file *rfile;
 	void __user *argp = compat_ptr(arg);
 
 	rfile = file->private_data;
