--- em8300-0.18.0-n/modules/em8300_main.c 2011-01-14 17:24:18.798732449 +0200 +++ em8300-0.18.0-nn/modules/em8300_main.c 2011-01-14 17:36:43.685891526 +0200 @@ -864,7 +864,12 @@ init_waitqueue_head(&em->sp_ptsfifo_wait); em->audio_driver_style = NONE; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) + /* TODO: check if this should be a mutex instead */ + sema_init(&em->audio_driver_style_lock, 1); +#else init_MUTEX(&em->audio_driver_style_lock); +#endif result = request_irq(dev->irq, em8300_irq, IRQF_SHARED | IRQF_DISABLED, "em8300", (void *) em); --- em8300-0.18.0-n/include/linux/em8300.h 2009-12-21 00:24:55.000000000 +0200 +++ em8300-0.18.0-nn/include/linux/em8300.h 2011-01-14 17:35:16.483771864 +0200 @@ -233,6 +233,9 @@ #include <linux/time.h> /* struct timeval */ #include <linux/wait.h> /* wait_queue_head_t */ #include <linux/list.h> /* struct list_head */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) +#include <linux/semaphore.h> /* struct semaphore */ +#endif #if defined(CONFIG_SND) || defined(CONFIG_SND_MODULE) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) --- em8300-0.18.0-n/modules/em8300_alsa.c 2009-12-21 00:24:55.000000000 +0200 +++ em8300-0.18.0-nn/modules/em8300_alsa.c 2011-01-14 17:50:49.185523277 +0200 @@ -487,7 +487,12 @@ memset(em8300_alsa, 0, sizeof(em8300_alsa_t)); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) + /* TODO: check if this should be a mutex instead */ + sema_init(&em8300_alsa->lock, 1); +#else init_MUTEX(&em8300_alsa->lock); +#endif em8300_alsa->em = em; em8300_alsa->card = card; --- em8300-0.18.0-n/modules/em8300_fifo.c 2009-12-21 00:24:55.000000000 +0200 +++ em8300-0.18.0-nn/modules/em8300_fifo.c 2011-01-14 17:51:17.594450229 +0200 @@ -115,7 +115,12 @@ } } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) + /* TODO: check if this should be a mutex instead */ + sema_init(&f->lock, 1); +#else init_MUTEX(&f->lock); +#endif f->valid = 1; return 0;