--- ../alsa-kernel/core/init.c	2009-09-07 15:59:08.000000000 +0200
+++ init.c	2009-09-07 16:04:43.000000000 +0200
@@ -1,3 +1,5 @@
+#define __NO_VERSION__
+#include "adriver.h"
 /*
  *  Initialization routines
  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
@@ -296,11 +298,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)
 {
@@ -314,16 +324,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
 };
@@ -651,9 +667,21 @@
 		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), card,
+						       "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), card,
 					       "card%i", card->number);
+#else
+		card->card_dev = device_create(sound_class, card->dev,
+					       MKDEV(0, 0),
+					       "card%i", card->number);
+		if (card->card_dev && !IS_ERR(card->card_dev))
+			dev_set_drvdata(card->card_dev, card);
+#endif
 		if (IS_ERR(card->card_dev))
 			card->card_dev = NULL;
 	}
@@ -945,3 +973,16 @@
 
 EXPORT_SYMBOL(snd_power_wait);
 #endif /* CONFIG_PM */
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+/* just for old ABI compatibility */
+struct snd_card *snd_card_new(int idx, const char *id,
+			      struct module *module, int extra_size)
+{
+	struct snd_card *card;
+	if (snd_card_create(idx, id, module, extra_size, &card) < 0)
+		return NULL;
+	return card;
+}
+EXPORT_SYMBOL(snd_card_new);
+#endif
