2 |
#include "../alsa-kernel/core/misc.c" |
#include "../alsa-kernel/core/misc.c" |
3 |
#include <linux/smp_lock.h> |
#include <linux/smp_lock.h> |
4 |
#include <linux/vmalloc.h> |
#include <linux/vmalloc.h> |
5 |
|
#include <linux/slab.h> |
6 |
|
|
7 |
|
|
8 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) |
72 |
pci_for_each_dev(dev) { |
pci_for_each_dev(dev) { |
73 |
struct pci_driver *drv = snd_pci_compat_get_pci_driver(dev); |
struct pci_driver *drv = snd_pci_compat_get_pci_driver(dev); |
74 |
if (drv && drv->suspend) |
if (drv && drv->suspend) |
75 |
drv->suspend(dev); |
drv->suspend(dev, 0); |
76 |
} |
} |
77 |
break; |
break; |
78 |
case PM_RESUME: |
case PM_RESUME: |
218 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) |
219 |
reparent_to_init(); |
reparent_to_init(); |
220 |
#endif |
#endif |
221 |
strcpy(current->comm, "snd-free"); /* FIXME: different names? */ |
strcpy(current->comm, "snd"); /* FIXME: different names? */ |
222 |
|
|
223 |
works->func(works->data); |
works->func(works->data); |
224 |
|
|
225 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) |
226 |
unlock_kernel(); |
unlock_kernel(); |
227 |
#endif |
#endif |
|
kfree(works); |
|
228 |
|
|
229 |
return 0; |
return 0; |
230 |
} |
} |
231 |
|
|
232 |
int snd_compat_schedule_work(struct work_struct *works) |
int snd_compat_schedule_work(struct work_struct *works) |
233 |
{ |
{ |
234 |
struct work_struct *wp = kmalloc(sizeof(*wp), GFP_KERNEL); |
return kernel_thread(work_caller, works, 0) >= 0; |
|
if (! wp) |
|
|
return 0; |
|
|
*wp = *works; |
|
|
return kernel_thread(work_caller, wp, 0) >= 0; |
|
235 |
} |
} |
236 |
|
|
237 |
#endif |
#endif |