--- ../alsa-kernel/core/info.c	2010-04-09 17:37:52.473468020 +0200
+++ info.c	2010-04-09 19:27:27.688965183 +0200
@@ -1,3 +1,4 @@
+#include "info.inc"
 /*
  *  Information interface for ALSA driver
  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
@@ -88,10 +89,18 @@
 	char *nbuf;
 
 	nsize = PAGE_ALIGN(nsize);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || \
+	defined(CONFIG_SND_DEBUG_MEMORY)
+	nbuf = kmalloc(nsize, GFP_KERNEL);
+	if (!nbuf)
+		return -ENOMEM;
+	memcpy(nbuf, buffer->buffer, buffer->len);
+	kfree(buffer->buffer);
+#else	
 	nbuf = krealloc(buffer->buffer, nsize, GFP_KERNEL);
 	if (! nbuf)
 		return -ENOMEM;
-
+#endif
 	buffer->buffer = nbuf;
 	buffer->len = nsize;
 	return 0;
@@ -152,13 +161,6 @@
 struct snd_info_entry *snd_oss_root;
 #endif
 
-static void snd_remove_proc_entry(struct proc_dir_entry *parent,
-				  struct proc_dir_entry *de)
-{
-	if (de)
-		remove_proc_entry(de->name, parent);
-}
-
 static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
 {
 	struct snd_info_private_data *data;
@@ -481,9 +483,26 @@
 	return -ENOTTY;
 }
 
+#ifndef CONFIG_SND_HAVE_NEW_IOCTL
+/* need to unlock BKL to allow preemption */
+static int snd_info_entry_ioctl_old(struct inode *inode, struct file * file,
+				    unsigned int cmd, unsigned long arg)
+{
+	int err;
+	unlock_kernel();
+	err = snd_info_entry_ioctl(file, cmd, arg);
+	lock_kernel();
+	return err;
+}
+#endif
+
 static int snd_info_entry_mmap(struct file *file, struct vm_area_struct *vma)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
 	struct inode *inode = file->f_path.dentry->d_inode;
+#else
+	struct inode *inode = file->f_dentry->d_inode;
+#endif
 	struct snd_info_private_data *data;
 	struct snd_info_entry *entry;
 
@@ -504,22 +523,35 @@
 
 static const struct file_operations snd_info_entry_operations =
 {
+#ifndef LINUX_2_2
 	.owner =		THIS_MODULE,
+#endif
 	.llseek =		snd_info_entry_llseek,
 	.read =			snd_info_entry_read,
 	.write =		snd_info_entry_write,
 	.poll =			snd_info_entry_poll,
+#ifdef CONFIG_SND_HAVE_NEW_IOCTL
 	.unlocked_ioctl =	snd_info_entry_ioctl,
+#else
+	.ioctl =		snd_info_entry_ioctl_old,
+#endif
 	.mmap =			snd_info_entry_mmap,
 	.open =			snd_info_entry_open,
 	.release =		snd_info_entry_release,
 };
 
+#ifdef LINUX_2_2
+static struct inode_operations snd_info_entry_inode_operations =
+{
+	&snd_info_entry_operations,	/* default sound info directory file-ops */
+}
+#endif
+
 int __init snd_info_init(void)
 {
 	struct proc_dir_entry *p;
 
-	p = create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
+	p = snd_create_proc_entry("asound", S_IFDIR | S_IRUGO | S_IXUGO, NULL);
 	if (p == NULL)
 		return -ENOMEM;
 	snd_proc_root = p;
@@ -907,6 +939,7 @@
 
 EXPORT_SYMBOL(snd_card_proc_new);
 
+
 /**
  * snd_info_free_entry - release the info entry
  * @entry: the info entry
@@ -946,13 +979,21 @@
 		return -ENXIO;
 	root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
 	mutex_lock(&info_mutex);
-	p = create_proc_entry(entry->name, entry->mode, root);
+	p = snd_create_proc_entry(entry->name, entry->mode, root);
 	if (!p) {
 		mutex_unlock(&info_mutex);
 		return -ENOMEM;
 	}
-	if (!S_ISDIR(entry->mode))
+#if defined(HAVE_PROCFS_OWNER) && defined(LINUX_2_2)
+	p->owner = entry->module;
+#endif
+	if (!S_ISDIR(entry->mode)) {
+#ifndef LINUX_2_2
 		p->proc_fops = &snd_info_entry_operations;
+#else
+		p->ops = &snd_info_entry_inode_operations;
+#endif
+	}
 	p->size = entry->size;
 	p->data = entry;
 	entry->p = p;
@@ -972,9 +1013,19 @@
 
 static void snd_info_version_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
+	static char *kernel_version = UTS_RELEASE;
+
 	snd_iprintf(buffer,
 		    "Advanced Linux Sound Architecture Driver Version "
 		    CONFIG_SND_VERSION CONFIG_SND_DATE ".\n"
+		    "Compiled on " __DATE__ " for kernel %s"
+#ifdef CONFIG_SMP
+		    " (SMP)"
+#endif
+#ifdef MODVERSIONS
+		    " with versioned symbols"
+#endif
+		    ".\n", kernel_version
 		   );
 }
 
