diff --git a/sound/core/rtctimer.c b/sound/core/rtctimer.c
index c3c1856..84704cc 100644
--- a/sound/core/rtctimer.c
+++ b/sound/core/rtctimer.c
@@ -40,16 +40,16 @@
 /*
  * prototypes
  */
-static int rtctimer_open(snd_timer_t *t);
-static int rtctimer_close(snd_timer_t *t);
-static int rtctimer_start(snd_timer_t *t);
-static int rtctimer_stop(snd_timer_t *t);
+static int rtctimer_open(struct snd_timer *t);
+static int rtctimer_close(struct snd_timer *t);
+static int rtctimer_start(struct snd_timer *t);
+static int rtctimer_stop(struct snd_timer *t);
 
 
 /*
  * The hardware dependent description for this timer.
  */
-static struct _snd_timer_hardware rtc_hw = {
+static struct snd_timer_hardware rtc_hw = {
 	.flags =	SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO,
 	.ticks =	100000000L,		/* FIXME: XXX */
 	.open =		rtctimer_open,
@@ -59,12 +59,12 @@
 };
 
 static int rtctimer_freq = RTC_FREQ;		/* frequency */
-static snd_timer_t *rtctimer;
+static struct snd_timer *rtctimer;
 static rtc_task_t rtc_task;
 
 
 static int
-rtctimer_open(snd_timer_t *t)
+rtctimer_open(struct snd_timer *t)
 {
 	int err;
 
@@ -76,7 +76,7 @@
 }
 
 static int
-rtctimer_close(snd_timer_t *t)
+rtctimer_close(struct snd_timer *t)
 {
 	rtc_task_t *rtc = t->private_data;
 	if (rtc) {
@@ -87,7 +87,7 @@
 }
 
 static int
-rtctimer_start(snd_timer_t *timer)
+rtctimer_start(struct snd_timer *timer)
 {
 	rtc_task_t *rtc = timer->private_data;
 	snd_assert(rtc != NULL, return -EINVAL);
@@ -97,7 +97,7 @@
 }
 
 static int
-rtctimer_stop(snd_timer_t *timer)
+rtctimer_stop(struct snd_timer *timer)
 {
 	rtc_task_t *rtc = timer->private_data;
 	snd_assert(rtc != NULL, return -EINVAL);
@@ -120,7 +120,7 @@
 static int __init rtctimer_init(void)
 {
 	int err;
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 
 	if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
 	    (rtctimer_freq & (rtctimer_freq - 1)) != 0) {
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 1b90a38..18d43a0 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -53,8 +53,8 @@
 module_param(timer_limit, int, 0444);
 MODULE_PARM_DESC(timer_limit, "Maximum global timers in system.");
 
-typedef struct {
-	snd_timer_instance_t *timeri;
+struct snd_timer_user {
+	struct snd_timer_instance *timeri;
 	int tread;		/* enhanced read with timestamps and events */
 	unsigned long ticks;
 	unsigned long overrun;
@@ -62,8 +62,8 @@
 	int qtail;
 	int qused;
 	int queue_size;
-	snd_timer_read_t *queue;
-	snd_timer_tread_t *tqueue;
+	struct snd_timer_read *queue;
+	struct snd_timer_tread *tqueue;
 	spinlock_t qlock;
 	unsigned long last_resolution;
 	unsigned int filter;
@@ -71,7 +71,7 @@
 	wait_queue_head_t qchange_sleep;
 	struct fasync_struct *fasync;
 	struct semaphore tread_sem;
-} snd_timer_user_t;
+};
 
 /* list of timers */
 static LIST_HEAD(snd_timer_list);
@@ -84,21 +84,21 @@
 
 static DECLARE_MUTEX(register_mutex);
 
-static int snd_timer_free(snd_timer_t *timer);
-static int snd_timer_dev_free(snd_device_t *device);
-static int snd_timer_dev_register(snd_device_t *device);
-static int snd_timer_dev_unregister(snd_device_t *device);
+static int snd_timer_free(struct snd_timer *timer);
+static int snd_timer_dev_free(struct snd_device *device);
+static int snd_timer_dev_register(struct snd_device *device);
+static int snd_timer_dev_unregister(struct snd_device *device);
 
-static void snd_timer_reschedule(snd_timer_t * timer, unsigned long ticks_left);
+static void snd_timer_reschedule(struct snd_timer * timer, unsigned long ticks_left);
 
 /*
  * create a timer instance with the given owner string.
  * when timer is not NULL, increments the module counter
  */
-static snd_timer_instance_t *snd_timer_instance_new(char *owner,
-						    snd_timer_t *timer)
+static struct snd_timer_instance *snd_timer_instance_new(char *owner,
+							 struct snd_timer *timer)
 {
-	snd_timer_instance_t *timeri;
+	struct snd_timer_instance *timeri;
 	timeri = kzalloc(sizeof(*timeri), GFP_KERNEL);
 	if (timeri == NULL)
 		return NULL;
@@ -126,13 +126,13 @@
 /*
  * find a timer instance from the given timer id
  */
-static snd_timer_t *snd_timer_find(snd_timer_id_t *tid)
+static struct snd_timer *snd_timer_find(struct snd_timer_id *tid)
 {
-	snd_timer_t *timer = NULL;
+	struct snd_timer *timer = NULL;
 	struct list_head *p;
 
 	list_for_each(p, &snd_timer_list) {
-		timer = list_entry(p, snd_timer_t, device_list);
+		timer = list_entry(p, struct snd_timer, device_list);
 
 		if (timer->tmr_class != tid->dev_class)
 			continue;
@@ -152,7 +152,7 @@
 
 #ifdef CONFIG_KMOD
 
-static void snd_timer_request(snd_timer_id_t *tid)
+static void snd_timer_request(struct snd_timer_id *tid)
 {
 	if (! current->fs->root)
 		return;
@@ -179,17 +179,17 @@
  *
  * call this with register_mutex down.
  */
-static void snd_timer_check_slave(snd_timer_instance_t *slave)
+static void snd_timer_check_slave(struct snd_timer_instance *slave)
 {
-	snd_timer_t *timer;
-	snd_timer_instance_t *master;
+	struct snd_timer *timer;
+	struct snd_timer_instance *master;
 	struct list_head *p, *q;
 
 	/* FIXME: it's really dumb to look up all entries.. */
 	list_for_each(p, &snd_timer_list) {
-		timer = list_entry(p, snd_timer_t, device_list);
+		timer = list_entry(p, struct snd_timer, device_list);
 		list_for_each(q, &timer->open_list_head) {
-			master = list_entry(q, snd_timer_instance_t, open_list);
+			master = list_entry(q, struct snd_timer_instance, open_list);
 			if (slave->slave_class == master->slave_class &&
 			    slave->slave_id == master->slave_id) {
 				list_del(&slave->open_list);
@@ -211,14 +211,14 @@
  *
  * call this with register_mutex down.
  */
-static void snd_timer_check_master(snd_timer_instance_t *master)
+static void snd_timer_check_master(struct snd_timer_instance *master)
 {
-	snd_timer_instance_t *slave;
+	struct snd_timer_instance *slave;
 	struct list_head *p, *n;
 
 	/* check all pending slaves */
 	list_for_each_safe(p, n, &snd_timer_slave_list) {
-		slave = list_entry(p, snd_timer_instance_t, open_list);
+		slave = list_entry(p, struct snd_timer_instance, open_list);
 		if (slave->slave_class == master->slave_class &&
 		    slave->slave_id == master->slave_id) {
 			list_del(p);
@@ -238,12 +238,12 @@
  * open a timer instance
  * when opening a master, the slave id must be here given.
  */
-int snd_timer_open(snd_timer_instance_t **ti,
-		   char *owner, snd_timer_id_t *tid,
+int snd_timer_open(struct snd_timer_instance **ti,
+		   char *owner, struct snd_timer_id *tid,
 		   unsigned int slave_id)
 {
-	snd_timer_t *timer;
-	snd_timer_instance_t *timeri = NULL;
+	struct snd_timer *timer;
+	struct snd_timer_instance *timeri = NULL;
 
 	if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) {
 		/* open a slave instance */
@@ -285,7 +285,7 @@
 	}
 	if (!list_empty(&timer->open_list_head)) {
 		timeri = list_entry(timer->open_list_head.next,
-				    snd_timer_instance_t, open_list);
+				    struct snd_timer_instance, open_list);
 		if (timeri->flags & SNDRV_TIMER_IFLG_EXCLUSIVE) {
 			up(&register_mutex);
 			return -EBUSY;
@@ -307,17 +307,17 @@
 	return 0;
 }
 
-static int _snd_timer_stop(snd_timer_instance_t * timeri,
-			   int keep_flag, enum sndrv_timer_event event);
+static int _snd_timer_stop(struct snd_timer_instance *timeri,
+			   int keep_flag, int event);
 
 /*
  * close a timer instance
  */
-int snd_timer_close(snd_timer_instance_t * timeri)
+int snd_timer_close(struct snd_timer_instance *timeri)
 {
-	snd_timer_t *timer = NULL;
+	struct snd_timer *timer = NULL;
 	struct list_head *p, *n;
-	snd_timer_instance_t *slave;
+	struct snd_timer_instance *slave;
 
 	snd_assert(timeri != NULL, return -ENXIO);
 
@@ -353,7 +353,7 @@
 			timer->hw.close(timer);
 		/* remove slave links */
 		list_for_each_safe(p, n, &timeri->slave_list_head) {
-			slave = list_entry(p, snd_timer_instance_t, open_list);
+			slave = list_entry(p, struct snd_timer_instance, open_list);
 			spin_lock_irq(&slave_active_lock);
 			_snd_timer_stop(slave, 1, SNDRV_TIMER_EVENT_RESOLUTION);
 			list_del(p);
@@ -373,9 +373,9 @@
 	return 0;
 }
 
-unsigned long snd_timer_resolution(snd_timer_instance_t * timeri)
+unsigned long snd_timer_resolution(struct snd_timer_instance *timeri)
 {
-	snd_timer_t * timer;
+	struct snd_timer * timer;
 
 	if (timeri == NULL)
 		return 0;
@@ -387,13 +387,12 @@
 	return 0;
 }
 
-static void snd_timer_notify1(snd_timer_instance_t *ti,
-			      enum sndrv_timer_event event)
+static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	unsigned long flags;
 	unsigned long resolution = 0;
-	snd_timer_instance_t *ts;
+	struct snd_timer_instance *ts;
 	struct list_head *n;
 	struct timespec tstamp;
 
@@ -414,14 +413,14 @@
 		return;
 	spin_lock_irqsave(&timer->lock, flags);
 	list_for_each(n, &ti->slave_active_head) {
-		ts = list_entry(n, snd_timer_instance_t, active_list);
+		ts = list_entry(n, struct snd_timer_instance, active_list);
 		if (ts->ccallback)
 			ts->ccallback(ti, event + 100, &tstamp, resolution);
 	}
 	spin_unlock_irqrestore(&timer->lock, flags);
 }
 
-static int snd_timer_start1(snd_timer_t *timer, snd_timer_instance_t *timeri,
+static int snd_timer_start1(struct snd_timer *timer, struct snd_timer_instance *timeri,
 			    unsigned long sticks)
 {
 	list_del(&timeri->active_list);
@@ -442,7 +441,7 @@
 	}
 }
 
-static int snd_timer_start_slave(snd_timer_instance_t *timeri)
+static int snd_timer_start_slave(struct snd_timer_instance *timeri)
 {
 	unsigned long flags;
 
@@ -458,9 +457,9 @@
 /*
  *  start the timer instance
  */
-int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks)
+int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	int result = -EINVAL;
 	unsigned long flags;
 
@@ -483,10 +482,10 @@
 	return result;
 }
 
-static int _snd_timer_stop(snd_timer_instance_t * timeri,
-			   int keep_flag, enum sndrv_timer_event event)
+static int _snd_timer_stop(struct snd_timer_instance * timeri,
+			   int keep_flag, int event)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	unsigned long flags;
 
 	snd_assert(timeri != NULL, return -ENXIO);
@@ -532,9 +531,9 @@
  *
  * do not call this from the timer callback!
  */
-int snd_timer_stop(snd_timer_instance_t * timeri)
+int snd_timer_stop(struct snd_timer_instance *timeri)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	unsigned long flags;
 	int err;
 
@@ -552,9 +551,9 @@
 /*
  * start again..  the tick is kept.
  */
-int snd_timer_continue(snd_timer_instance_t * timeri)
+int snd_timer_continue(struct snd_timer_instance *timeri)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	int result = -EINVAL;
 	unsigned long flags;
 
@@ -578,7 +577,7 @@
 /*
  * pause.. remember the ticks left
  */
-int snd_timer_pause(snd_timer_instance_t * timeri)
+int snd_timer_pause(struct snd_timer_instance * timeri)
 {
 	return _snd_timer_stop(timeri, 0, SNDRV_TIMER_EVENT_PAUSE);
 }
@@ -589,14 +588,14 @@
  * start pending instances and check the scheduling ticks.
  * when the scheduling ticks is changed set CHANGE flag to reprogram the timer.
  */
-static void snd_timer_reschedule(snd_timer_t * timer, unsigned long ticks_left)
+static void snd_timer_reschedule(struct snd_timer * timer, unsigned long ticks_left)
 {
-	snd_timer_instance_t *ti;
+	struct snd_timer_instance *ti;
 	unsigned long ticks = ~0UL;
 	struct list_head *p;
 
 	list_for_each(p, &timer->active_list_head) {
-		ti = list_entry(p, snd_timer_instance_t, active_list);
+		ti = list_entry(p, struct snd_timer_instance, active_list);
 		if (ti->flags & SNDRV_TIMER_IFLG_START) {
 			ti->flags &= ~SNDRV_TIMER_IFLG_START;
 			ti->flags |= SNDRV_TIMER_IFLG_RUNNING;
@@ -624,8 +623,8 @@
  */
 static void snd_timer_tasklet(unsigned long arg)
 {
-	snd_timer_t *timer = (snd_timer_t *) arg;
-	snd_timer_instance_t *ti;
+	struct snd_timer *timer = (struct snd_timer *) arg;
+	struct snd_timer_instance *ti;
 	struct list_head *p;
 	unsigned long resolution, ticks;
 
@@ -633,7 +632,7 @@
 	/* now process all callbacks */
 	while (!list_empty(&timer->sack_list_head)) {
 		p = timer->sack_list_head.next;		/* get first item */
-		ti = list_entry(p, snd_timer_instance_t, ack_list);
+		ti = list_entry(p, struct snd_timer_instance, ack_list);
 
 		/* remove from ack_list and make empty */
 		list_del_init(p);
@@ -658,9 +657,9 @@
  * ticks_left is usually equal to timer->sticks.
  *
  */
-void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left)
+void snd_timer_interrupt(struct snd_timer * timer, unsigned long ticks_left)
 {
-	snd_timer_instance_t *ti, *ts;
+	struct snd_timer_instance *ti, *ts;
 	unsigned long resolution, ticks;
 	struct list_head *p, *q, *n, *ack_list_head;
 	int use_tasklet = 0;
@@ -682,7 +681,7 @@
 	 * is called.
 	 */
 	list_for_each_safe(p, n, &timer->active_list_head) {
-		ti = list_entry(p, snd_timer_instance_t, active_list);
+		ti = list_entry(p, struct snd_timer_instance, active_list);
 		if (!(ti->flags & SNDRV_TIMER_IFLG_RUNNING))
 			continue;
 		ti->pticks += ticks_left;
@@ -708,7 +707,7 @@
 		if (list_empty(&ti->ack_list))
 			list_add_tail(&ti->ack_list, ack_list_head);
 		list_for_each(q, &ti->slave_active_head) {
-			ts = list_entry(q, snd_timer_instance_t, active_list);
+			ts = list_entry(q, struct snd_timer_instance, active_list);
 			ts->pticks = ti->pticks;
 			ts->resolution = resolution;
 			if (list_empty(&ts->ack_list))
@@ -735,7 +734,7 @@
 	/* now process all fast callbacks */
 	while (!list_empty(&timer->ack_list_head)) {
 		p = timer->ack_list_head.next;		/* get first item */
-		ti = list_entry(p, snd_timer_instance_t, ack_list);
+		ti = list_entry(p, struct snd_timer_instance, ack_list);
 
 		/* remove from ack_list and make empty */
 		list_del_init(p);
@@ -763,12 +762,12 @@
 
  */
 
-int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid,
-		  snd_timer_t **rtimer)
+int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid,
+		  struct snd_timer **rtimer)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	int err;
-	static snd_device_ops_t ops = {
+	static struct snd_device_ops ops = {
 		.dev_free = snd_timer_dev_free,
 		.dev_register = snd_timer_dev_register,
 		.dev_unregister = snd_timer_dev_unregister
@@ -806,7 +805,7 @@
 	return 0;
 }
 
-static int snd_timer_free(snd_timer_t *timer)
+static int snd_timer_free(struct snd_timer *timer)
 {
 	snd_assert(timer != NULL, return -ENXIO);
 	if (timer->private_free)
@@ -815,16 +814,16 @@
 	return 0;
 }
 
-static int snd_timer_dev_free(snd_device_t *device)
+static int snd_timer_dev_free(struct snd_device *device)
 {
-	snd_timer_t *timer = device->device_data;
+	struct snd_timer *timer = device->device_data;
 	return snd_timer_free(timer);
 }
 
-static int snd_timer_dev_register(snd_device_t *dev)
+static int snd_timer_dev_register(struct snd_device *dev)
 {
-	snd_timer_t *timer = dev->device_data;
-	snd_timer_t *timer1;
+	struct snd_timer *timer = dev->device_data;
+	struct snd_timer *timer1;
 	struct list_head *p;
 
 	snd_assert(timer != NULL && timer->hw.start != NULL &&
@@ -835,7 +834,7 @@
 
 	down(&register_mutex);
 	list_for_each(p, &snd_timer_list) {
-		timer1 = list_entry(p, snd_timer_t, device_list);
+		timer1 = list_entry(p, struct snd_timer, device_list);
 		if (timer1->tmr_class > timer->tmr_class)
 			break;
 		if (timer1->tmr_class < timer->tmr_class)
@@ -863,10 +862,10 @@
 	return 0;
 }
 
-static int snd_timer_unregister(snd_timer_t *timer)
+static int snd_timer_unregister(struct snd_timer *timer)
 {
 	struct list_head *p, *n;
-	snd_timer_instance_t *ti;
+	struct snd_timer_instance *ti;
 
 	snd_assert(timer != NULL, return -ENXIO);
 	down(&register_mutex);
@@ -874,7 +873,7 @@
 		snd_printk(KERN_WARNING "timer 0x%lx is busy?\n", (long)timer);
 		list_for_each_safe(p, n, &timer->open_list_head) {
 			list_del_init(p);
-			ti = list_entry(p, snd_timer_instance_t, open_list);
+			ti = list_entry(p, struct snd_timer_instance, open_list);
 			ti->timer = NULL;
 		}
 	}
@@ -883,18 +882,17 @@
 	return snd_timer_free(timer);
 }
 
-static int snd_timer_dev_unregister(snd_device_t *device)
+static int snd_timer_dev_unregister(struct snd_device *device)
 {
-	snd_timer_t *timer = device->device_data;
+	struct snd_timer *timer = device->device_data;
 	return snd_timer_unregister(timer);
 }
 
-void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event,
-		      struct timespec *tstamp)
+void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp)
 {
 	unsigned long flags;
 	unsigned long resolution = 0;
-	snd_timer_instance_t *ti, *ts;
+	struct snd_timer_instance *ti, *ts;
 	struct list_head *p, *n;
 
 	if (! (timer->hw.flags & SNDRV_TIMER_HW_SLAVE))
@@ -911,11 +909,11 @@
 			resolution = timer->hw.resolution;
 	}
 	list_for_each(p, &timer->active_list_head) {
-		ti = list_entry(p, snd_timer_instance_t, active_list);
+		ti = list_entry(p, struct snd_timer_instance, active_list);
 		if (ti->ccallback)
 			ti->ccallback(ti, event, tstamp, resolution);
 		list_for_each(n, &ti->slave_active_head) {
-			ts = list_entry(n, snd_timer_instance_t, active_list);
+			ts = list_entry(n, struct snd_timer_instance, active_list);
 			if (ts->ccallback)
 				ts->ccallback(ts, event, tstamp, resolution);
 		}
@@ -926,9 +924,9 @@
 /*
  * exported functions for global timers
  */
-int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer)
+int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer)
 {
-	snd_timer_id_t tid;
+	struct snd_timer_id tid;
 
 	tid.dev_class = SNDRV_TIMER_CLASS_GLOBAL;
 	tid.dev_sclass = SNDRV_TIMER_SCLASS_NONE;
@@ -938,21 +936,21 @@
 	return snd_timer_new(NULL, id, &tid, rtimer);
 }
 
-int snd_timer_global_free(snd_timer_t *timer)
+int snd_timer_global_free(struct snd_timer *timer)
 {
 	return snd_timer_free(timer);
 }
 
-int snd_timer_global_register(snd_timer_t *timer)
+int snd_timer_global_register(struct snd_timer *timer)
 {
-	snd_device_t dev;
+	struct snd_device dev;
 
 	memset(&dev, 0, sizeof(dev));
 	dev.device_data = timer;
 	return snd_timer_dev_register(&dev);
 }
 
-int snd_timer_global_unregister(snd_timer_t *timer)
+int snd_timer_global_unregister(struct snd_timer *timer)
 {
 	return snd_timer_unregister(timer);
 }
@@ -971,7 +969,7 @@
 
 static void snd_timer_s_function(unsigned long data)
 {
-	snd_timer_t *timer = (snd_timer_t *)data;
+	struct snd_timer *timer = (struct snd_timer *)data;
 	struct snd_timer_system_private *priv = timer->private_data;
 	unsigned long jiff = jiffies;
 	if (time_after(jiff, priv->last_expires))
@@ -979,7 +977,7 @@
 	snd_timer_interrupt(timer, (long)jiff - (long)priv->last_jiffies);
 }
 
-static int snd_timer_s_start(snd_timer_t * timer)
+static int snd_timer_s_start(struct snd_timer * timer)
 {
 	struct snd_timer_system_private *priv;
 	unsigned long njiff;
@@ -998,7 +996,7 @@
 	return 0;
 }
 
-static int snd_timer_s_stop(snd_timer_t * timer)
+static int snd_timer_s_stop(struct snd_timer * timer)
 {
 	struct snd_timer_system_private *priv;
 	unsigned long jiff;
@@ -1013,7 +1011,7 @@
 	return 0;
 }
 
-static struct _snd_timer_hardware snd_timer_system =
+static struct snd_timer_hardware snd_timer_system =
 {
 	.flags =	SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET,
 	.resolution =	1000000000L / HZ,
@@ -1022,14 +1020,14 @@
 	.stop =		snd_timer_s_stop
 };
 
-static void snd_timer_free_system(snd_timer_t *timer)
+static void snd_timer_free_system(struct snd_timer *timer)
 {
 	kfree(timer->private_data);
 }
 
 static int snd_timer_register_system(void)
 {
-	snd_timer_t *timer;
+	struct snd_timer *timer;
 	struct snd_timer_system_private *priv;
 	int err;
 
@@ -1055,17 +1053,17 @@
  *  Info interface
  */
 
-static void snd_timer_proc_read(snd_info_entry_t *entry,
-				snd_info_buffer_t * buffer)
+static void snd_timer_proc_read(struct snd_info_entry *entry,
+				struct snd_info_buffer *buffer)
 {
 	unsigned long flags;
-	snd_timer_t *timer;
-	snd_timer_instance_t *ti;
+	struct snd_timer *timer;
+	struct snd_timer_instance *ti;
 	struct list_head *p, *q;
 
 	down(&register_mutex);
 	list_for_each(p, &snd_timer_list) {
-		timer = list_entry(p, snd_timer_t, device_list);
+		timer = list_entry(p, struct snd_timer, device_list);
 		switch (timer->tmr_class) {
 		case SNDRV_TIMER_CLASS_GLOBAL:
 			snd_iprintf(buffer, "G%i: ", timer->tmr_device);
@@ -1094,7 +1092,7 @@
 		snd_iprintf(buffer, "\n");
 		spin_lock_irqsave(&timer->lock, flags);
 		list_for_each(q, &timer->open_list_head) {
-			ti = list_entry(q, snd_timer_instance_t, open_list);
+			ti = list_entry(q, struct snd_timer_instance, open_list);
 			snd_iprintf(buffer, "  Client %s : %s\n",
 				    ti->owner ? ti->owner : "unknown",
 				    ti->flags & (SNDRV_TIMER_IFLG_START |
@@ -1110,12 +1108,12 @@
  *  USER SPACE interface
  */
 
-static void snd_timer_user_interrupt(snd_timer_instance_t *timeri,
+static void snd_timer_user_interrupt(struct snd_timer_instance *timeri,
 				     unsigned long resolution,
 				     unsigned long ticks)
 {
-	snd_timer_user_t *tu = timeri->callback_data;
-	snd_timer_read_t *r;
+	struct snd_timer_user *tu = timeri->callback_data;
+	struct snd_timer_read *r;
 	int prev;
 
 	spin_lock(&tu->qlock);
@@ -1142,8 +1140,8 @@
 	wake_up(&tu->qchange_sleep);
 }
 
-static void snd_timer_user_append_to_tqueue(snd_timer_user_t *tu,
-					    snd_timer_tread_t *tread)
+static void snd_timer_user_append_to_tqueue(struct snd_timer_user *tu,
+					    struct snd_timer_tread *tread)
 {
 	if (tu->qused >= tu->queue_size) {
 		tu->overrun++;
@@ -1154,13 +1152,13 @@
 	}
 }
 
-static void snd_timer_user_ccallback(snd_timer_instance_t *timeri,
-				     enum sndrv_timer_event event,
+static void snd_timer_user_ccallback(struct snd_timer_instance *timeri,
+				     int event,
 				     struct timespec *tstamp,
 				     unsigned long resolution)
 {
-	snd_timer_user_t *tu = timeri->callback_data;
-	snd_timer_tread_t r1;
+	struct snd_timer_user *tu = timeri->callback_data;
+	struct snd_timer_tread r1;
 
 	if (event >= SNDRV_TIMER_EVENT_START &&
 	    event <= SNDRV_TIMER_EVENT_PAUSE)
@@ -1177,12 +1175,12 @@
 	wake_up(&tu->qchange_sleep);
 }
 
-static void snd_timer_user_tinterrupt(snd_timer_instance_t *timeri,
+static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri,
 				      unsigned long resolution,
 				      unsigned long ticks)
 {
-	snd_timer_user_t *tu = timeri->callback_data;
-	snd_timer_tread_t *r, r1;
+	struct snd_timer_user *tu = timeri->callback_data;
+	struct snd_timer_tread *r, r1;
 	struct timespec tstamp;
 	int prev, append = 0;
 
@@ -1233,7 +1231,7 @@
 
 static int snd_timer_user_open(struct inode *inode, struct file *file)
 {
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 
 	tu = kzalloc(sizeof(*tu), GFP_KERNEL);
 	if (tu == NULL)
@@ -1243,7 +1241,7 @@
 	init_MUTEX(&tu->tread_sem);
 	tu->ticks = 1;
 	tu->queue_size = 128;
-	tu->queue = kmalloc(tu->queue_size * sizeof(snd_timer_read_t),
+	tu->queue = kmalloc(tu->queue_size * sizeof(struct snd_timer_read),
 			    GFP_KERNEL);
 	if (tu->queue == NULL) {
 		kfree(tu);
@@ -1255,7 +1253,7 @@
 
 static int snd_timer_user_release(struct inode *inode, struct file *file)
 {
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 
 	if (file->private_data) {
 		tu = file->private_data;
@@ -1270,7 +1268,7 @@
 	return 0;
 }
 
-static void snd_timer_user_zero_id(snd_timer_id_t *id)
+static void snd_timer_user_zero_id(struct snd_timer_id *id)
 {
 	id->dev_class = SNDRV_TIMER_CLASS_NONE;
 	id->dev_sclass = SNDRV_TIMER_SCLASS_NONE;
@@ -1279,7 +1277,7 @@
 	id->subdevice = -1;
 }
 
-static void snd_timer_user_copy_id(snd_timer_id_t *id, snd_timer_t *timer)
+static void snd_timer_user_copy_id(struct snd_timer_id *id, struct snd_timer *timer)
 {
 	id->dev_class = timer->tmr_class;
 	id->dev_sclass = SNDRV_TIMER_SCLASS_NONE;
@@ -1288,10 +1286,10 @@
 	id->subdevice = timer->tmr_subdevice;
 }
 
-static int snd_timer_user_next_device(snd_timer_id_t __user *_tid)
+static int snd_timer_user_next_device(struct snd_timer_id __user *_tid)
 {
-	snd_timer_id_t id;
-	snd_timer_t *timer;
+	struct snd_timer_id id;
+	struct snd_timer *timer;
 	struct list_head *p;
 
 	if (copy_from_user(&id, _tid, sizeof(id)))
@@ -1302,7 +1300,7 @@
 			snd_timer_user_zero_id(&id);
 		else {
 			timer = list_entry(snd_timer_list.next,
-					   snd_timer_t, device_list);
+					   struct snd_timer, device_list);
 			snd_timer_user_copy_id(&id, timer);
 		}
 	} else {
@@ -1310,7 +1308,7 @@
 		case SNDRV_TIMER_CLASS_GLOBAL:
 			id.device = id.device < 0 ? 0 : id.device + 1;
 			list_for_each(p, &snd_timer_list) {
-				timer = list_entry(p, snd_timer_t, device_list);
+				timer = list_entry(p, struct snd_timer, device_list);
 				if (timer->tmr_class > SNDRV_TIMER_CLASS_GLOBAL) {
 					snd_timer_user_copy_id(&id, timer);
 					break;
@@ -1343,7 +1341,7 @@
 				}
 			}
 			list_for_each(p, &snd_timer_list) {
-				timer = list_entry(p, snd_timer_t, device_list);
+				timer = list_entry(p, struct snd_timer, device_list);
 				if (timer->tmr_class > id.dev_class) {
 					snd_timer_user_copy_id(&id, timer);
 					break;
@@ -1385,11 +1383,11 @@
 }
 
 static int snd_timer_user_ginfo(struct file *file,
-				snd_timer_ginfo_t __user *_ginfo)
+				struct snd_timer_ginfo __user *_ginfo)
 {
-	snd_timer_ginfo_t *ginfo;
-	snd_timer_id_t tid;
-	snd_timer_t *t;
+	struct snd_timer_ginfo *ginfo;
+	struct snd_timer_id tid;
+	struct snd_timer *t;
 	struct list_head *p;
 	int err = 0;
 
@@ -1430,10 +1428,10 @@
 }
 
 static int snd_timer_user_gparams(struct file *file,
-				  snd_timer_gparams_t __user *_gparams)
+				  struct snd_timer_gparams __user *_gparams)
 {
-	snd_timer_gparams_t gparams;
-	snd_timer_t *t;
+	struct snd_timer_gparams gparams;
+	struct snd_timer *t;
 	int err;
 
 	if (copy_from_user(&gparams, _gparams, sizeof(gparams)))
@@ -1459,11 +1457,11 @@
 }
 
 static int snd_timer_user_gstatus(struct file *file,
-				  snd_timer_gstatus_t __user *_gstatus)
+				  struct snd_timer_gstatus __user *_gstatus)
 {
-	snd_timer_gstatus_t gstatus;
-	snd_timer_id_t tid;
-	snd_timer_t *t;
+	struct snd_timer_gstatus gstatus;
+	struct snd_timer_id tid;
+	struct snd_timer *t;
 	int err = 0;
 
 	if (copy_from_user(&gstatus, _gstatus, sizeof(gstatus)))
@@ -1495,10 +1493,10 @@
 }
 
 static int snd_timer_user_tselect(struct file *file,
-				  snd_timer_select_t __user *_tselect)
+				  struct snd_timer_select __user *_tselect)
 {
-	snd_timer_user_t *tu;
-	snd_timer_select_t tselect;
+	struct snd_timer_user *tu;
+	struct snd_timer_select tselect;
 	char str[32];
 	int err = 0;
 
@@ -1524,12 +1522,12 @@
 	kfree(tu->tqueue);
 	tu->tqueue = NULL;
 	if (tu->tread) {
-		tu->tqueue = kmalloc(tu->queue_size * sizeof(snd_timer_tread_t),
+		tu->tqueue = kmalloc(tu->queue_size * sizeof(struct snd_timer_tread),
 				     GFP_KERNEL);
 		if (tu->tqueue == NULL)
 			err = -ENOMEM;
 	} else {
-		tu->queue = kmalloc(tu->queue_size * sizeof(snd_timer_read_t),
+		tu->queue = kmalloc(tu->queue_size * sizeof(struct snd_timer_read),
 				    GFP_KERNEL);
 		if (tu->queue == NULL)
 			err = -ENOMEM;
@@ -1552,11 +1550,11 @@
 }
 
 static int snd_timer_user_info(struct file *file,
-			       snd_timer_info_t __user *_info)
+			       struct snd_timer_info __user *_info)
 {
-	snd_timer_user_t *tu;
-	snd_timer_info_t *info;
-	snd_timer_t *t;
+	struct snd_timer_user *tu;
+	struct snd_timer_info *info;
+	struct snd_timer *t;
 	int err = 0;
 
 	tu = file->private_data;
@@ -1580,13 +1578,13 @@
 }
 
 static int snd_timer_user_params(struct file *file,
-				 snd_timer_params_t __user *_params)
+				 struct snd_timer_params __user *_params)
 {
-	snd_timer_user_t *tu;
-	snd_timer_params_t params;
-	snd_timer_t *t;
-	snd_timer_read_t *tr;
-	snd_timer_tread_t *ttr;
+	struct snd_timer_user *tu;
+	struct snd_timer_params params;
+	struct snd_timer *t;
+	struct snd_timer_read *tr;
+	struct snd_timer_tread *ttr;
 	int err;
 
 	tu = file->private_data;
@@ -1656,14 +1654,14 @@
 	tu->qhead = tu->qtail = tu->qused = 0;
 	if (tu->timeri->flags & SNDRV_TIMER_IFLG_EARLY_EVENT) {
 		if (tu->tread) {
-			snd_timer_tread_t tread;
+			struct snd_timer_tread tread;
 			tread.event = SNDRV_TIMER_EVENT_EARLY;
 			tread.tstamp.tv_sec = 0;
 			tread.tstamp.tv_nsec = 0;
 			tread.val = 0;
 			snd_timer_user_append_to_tqueue(tu, &tread);
 		} else {
-			snd_timer_read_t *r = &tu->queue[0];
+			struct snd_timer_read *r = &tu->queue[0];
 			r->resolution = 0;
 			r->ticks = 0;
 			tu->qused++;
@@ -1680,10 +1678,10 @@
 }
 
 static int snd_timer_user_status(struct file *file,
-				 snd_timer_status_t __user *_status)
+				 struct snd_timer_status __user *_status)
 {
-	snd_timer_user_t *tu;
-	snd_timer_status_t status;
+	struct snd_timer_user *tu;
+	struct snd_timer_status status;
 
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -1703,7 +1701,7 @@
 static int snd_timer_user_start(struct file *file)
 {
 	int err;
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -1716,7 +1714,7 @@
 static int snd_timer_user_stop(struct file *file)
 {
 	int err;
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -1726,7 +1724,7 @@
 static int snd_timer_user_continue(struct file *file)
 {
 	int err;
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -1737,7 +1735,7 @@
 static int snd_timer_user_pause(struct file *file)
 {
 	int err;
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -1754,7 +1752,7 @@
 static long snd_timer_user_ioctl(struct file *file, unsigned int cmd,
 				 unsigned long arg)
 {
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 	void __user *argp = (void __user *)arg;
 	int __user *p = argp;
 
@@ -1813,7 +1811,7 @@
 
 static int snd_timer_user_fasync(int fd, struct file * file, int on)
 {
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 	int err;
 
 	tu = file->private_data;
@@ -1826,12 +1824,12 @@
 static ssize_t snd_timer_user_read(struct file *file, char __user *buffer,
 				   size_t count, loff_t *offset)
 {
-	snd_timer_user_t *tu;
+	struct snd_timer_user *tu;
 	long result = 0, unit;
 	int err = 0;
 
 	tu = file->private_data;
-	unit = tu->tread ? sizeof(snd_timer_tread_t) : sizeof(snd_timer_read_t);
+	unit = tu->tread ? sizeof(struct snd_timer_tread) : sizeof(struct snd_timer_read);
 	spin_lock_irq(&tu->qlock);
 	while ((long)count - result >= unit) {
 		while (!tu->qused) {
@@ -1864,13 +1862,13 @@
 
 		if (tu->tread) {
 			if (copy_to_user(buffer, &tu->tqueue[tu->qhead++],
-					 sizeof(snd_timer_tread_t))) {
+					 sizeof(struct snd_timer_tread))) {
 				err = -EFAULT;
 				goto _error;
 			}
 		} else {
 			if (copy_to_user(buffer, &tu->queue[tu->qhead++],
-					 sizeof(snd_timer_read_t))) {
+					 sizeof(struct snd_timer_read))) {
 				err = -EFAULT;
 				goto _error;
 			}
@@ -1892,7 +1890,7 @@
 static unsigned int snd_timer_user_poll(struct file *file, poll_table * wait)
 {
         unsigned int mask;
-        snd_timer_user_t *tu;
+        struct snd_timer_user *tu;
 
         tu = file->private_data;
 
@@ -1923,7 +1921,7 @@
 	.fasync = 	snd_timer_user_fasync,
 };
 
-static snd_minor_t snd_timer_reg =
+static struct snd_minor snd_timer_reg =
 {
 	.comment =	"timer",
 	.f_ops =	&snd_timer_f_ops,
@@ -1933,12 +1931,12 @@
  *  ENTRY functions
  */
 
-static snd_info_entry_t *snd_timer_proc_entry = NULL;
+static struct snd_info_entry *snd_timer_proc_entry = NULL;
 
 static int __init alsa_timer_init(void)
 {
 	int err;
-	snd_info_entry_t *entry;
+	struct snd_info_entry *entry;
 
 #ifdef SNDRV_OSS_INFO_DEV_TIMERS
 	snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1,
@@ -1971,7 +1969,7 @@
 	snd_unregister_device(SNDRV_DEVICE_TYPE_TIMER, NULL, 0);
 	/* unregister the system timer */
 	list_for_each_safe(p, n, &snd_timer_list) {
-		snd_timer_t *timer = list_entry(p, snd_timer_t, device_list);
+		struct snd_timer *timer = list_entry(p, struct snd_timer, device_list);
 		snd_timer_unregister(timer);
 	}
 	if (snd_timer_proc_entry) {
diff --git a/sound/core/timer_compat.c b/sound/core/timer_compat.c
index 3de552d..5512f53 100644
--- a/sound/core/timer_compat.c
+++ b/sound/core/timer_compat.c
@@ -22,7 +22,7 @@
 
 #include <linux/compat.h>
 
-struct sndrv_timer_info32 {
+struct snd_timer_info32 {
 	u32 flags;
 	s32 card;
 	unsigned char id[64];
@@ -33,11 +33,11 @@
 };
 
 static int snd_timer_user_info_compat(struct file *file,
-				      struct sndrv_timer_info32 __user *_info)
+				      struct snd_timer_info32 __user *_info)
 {
-	snd_timer_user_t *tu;
-	struct sndrv_timer_info32 info;
-	snd_timer_t *t;
+	struct snd_timer_user *tu;
+	struct snd_timer_info32 info;
+	struct snd_timer *t;
 
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -55,7 +55,7 @@
 	return 0;
 }
 
-struct sndrv_timer_status32 {
+struct snd_timer_status32 {
 	struct compat_timespec tstamp;
 	u32 resolution;
 	u32 lost;
@@ -65,10 +65,10 @@
 };
 
 static int snd_timer_user_status_compat(struct file *file,
-					struct sndrv_timer_status32 __user *_status)
+					struct snd_timer_status32 __user *_status)
 {
-	snd_timer_user_t *tu;
-	snd_timer_status_t status;
+	struct snd_timer_user *tu;
+	struct snd_timer_status status;
 	
 	tu = file->private_data;
 	snd_assert(tu->timeri != NULL, return -ENXIO);
@@ -89,8 +89,8 @@
  */
 
 enum {
-	SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct sndrv_timer_info32),
-	SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct sndrv_timer_status32),
+	SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32),
+	SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct snd_timer_status32),
 };
 
 static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
