--- ../alsa-kernel/core/init.c	2008-10-17 14:14:13.000000000 +0200
+++ init.c	2008-10-17 14:16:03.000000000 +0200
@@ -1,3 +1,5 @@
+#define __NO_VERSION__
+#include "adriver.h"
 /*
  *  Initialization routines
  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
@@ -275,11 +277,19 @@
 	return POLLERR | POLLNVAL;
 }
 
+#ifdef CONFIG_SND_HAVE_NEW_IOCTL
 static long snd_disconnect_ioctl(struct file *file,
 				 unsigned int cmd, unsigned long arg)
 {
 	return -ENODEV;
 }
+#else
+static int snd_disconnect_ioctl_old(struct inode *inode, struct file *file,
+				    unsigned int cmd, unsigned long arg)
+{
+	return -ENODEV;
+}
+#endif
 
 static int snd_disconnect_mmap(struct file *file, struct vm_area_struct *vma)
 {
@@ -293,16 +303,22 @@
 
 static const struct file_operations snd_shutdown_f_ops =
 {
+#ifndef LINUX_2_2
 	.owner = 	THIS_MODULE,
+#endif
 	.llseek =	snd_disconnect_llseek,
 	.read = 	snd_disconnect_read,
 	.write =	snd_disconnect_write,
 	.release =	snd_disconnect_release,
 	.poll =		snd_disconnect_poll,
+#ifdef CONFIG_SND_HAVE_NEW_IOCTL
 	.unlocked_ioctl = snd_disconnect_ioctl,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl = snd_disconnect_ioctl,
 #endif
+#else
+	.ioctl =	snd_disconnect_ioctl_old,
+#endif
 	.mmap =		snd_disconnect_mmap,
 	.fasync =	snd_disconnect_fasync
 };
@@ -549,9 +565,19 @@
 		return -EINVAL;
 #ifndef CONFIG_SYSFS_DEPRECATED
 	if (!card->card_dev) {
+#ifdef CONFIG_SND_HAS_DEVICE_CREATE_DRVDATA
+		card->card_dev = device_create_drvdata(sound_class, card->dev,
+						       MKDEV(0, 0), NULL,
+						       "card%i", card->number);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
 		card->card_dev = device_create(sound_class, card->dev,
 					       MKDEV(0, 0), NULL,
 					       "card%i", card->number);
+#else
+		card->card_dev = device_create(sound_class, card->dev,
+					       MKDEV(0, 0),
+					       "card%i", card->number);
+#endif
 		if (IS_ERR(card->card_dev))
 			card->card_dev = NULL;
 	}
