--- sound.c.old	2004-01-27 21:50:32.000000000 +0100
+++ sound.c	2004-01-27 21:52:04.000000000 +0100
@@ -69,7 +69,11 @@
 
 static DECLARE_MUTEX(sound_mutex);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 2)
 extern struct class_simple *sound_class;
+#else
+#define sound_class NULL
+#endif
 
 
 #ifdef CONFIG_KMOD
@@ -165,7 +169,9 @@
 
 struct file_operations snd_fops =
 {
+#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
+#endif
 	.open =		snd_open
 };
 
@@ -378,6 +384,9 @@
 #ifndef MODULE
 	printk(KERN_INFO "Advanced Linux Sound Architecture Driver Version " CONFIG_SND_VERSION CONFIG_SND_DATE ".\n");
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)
+	pm_init();
+#endif
 	return 0;
 }
 
@@ -394,6 +403,9 @@
 	snd_info_minor_unregister();
 #endif
 	snd_info_done();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)
+	pm_done();
+#endif
 #ifdef CONFIG_SND_DEBUG_MEMORY
 	snd_memory_done();
 #endif
@@ -524,3 +536,5 @@
 EXPORT_SYMBOL(snd_wrapper_vmalloc);
 EXPORT_SYMBOL(snd_wrapper_vfree);
 #endif
+
+#include "sound.inc"
