diff options
author | Nick Piggin <npiggin@suse.de> | 2007-12-13 16:16:40 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 17:29:32 +0100 |
commit | eb415b8f6d1b259ea31b3093df958054380f7f8f (patch) | |
tree | bade9785fdcc99b78e5db950e5779399f071b91a /sound/usb/usx2y/usx2yhwdeppcm.c | |
parent | 3ad5afcd5fa91a00a9a19b9e39958acd9a3a25d7 (diff) | |
download | blackbird-op-linux-eb415b8f6d1b259ea31b3093df958054380f7f8f.tar.gz blackbird-op-linux-eb415b8f6d1b259ea31b3093df958054380f7f8f.zip |
[ALSA] alsa: usx2y nopage
Convert alsa usx2y driver from nopage to fault.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/usb/usx2y/usx2yhwdeppcm.c')
-rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index a5e7bcd7ca2e..800b5cecfc80 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -683,30 +683,24 @@ static void snd_usX2Y_hwdep_pcm_vm_close(struct vm_area_struct *area) } -static struct page * snd_usX2Y_hwdep_pcm_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type) +static int snd_usX2Y_hwdep_pcm_vm_fault(struct vm_area_struct *area, + struct vm_fault *vmf) { unsigned long offset; - struct page *page; void *vaddr; - offset = area->vm_pgoff << PAGE_SHIFT; - offset += address - area->vm_start; - snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_OOM); + offset = vmf->pgoff << PAGE_SHIFT; vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->hwdep_pcm_shm + offset; - page = virt_to_page(vaddr); - get_page(page); - - if (type) - *type = VM_FAULT_MINOR; - - return page; + vmf->page = virt_to_page(vaddr); + get_page(vmf->page); + return 0; } static struct vm_operations_struct snd_usX2Y_hwdep_pcm_vm_ops = { .open = snd_usX2Y_hwdep_pcm_vm_open, .close = snd_usX2Y_hwdep_pcm_vm_close, - .nopage = snd_usX2Y_hwdep_pcm_vm_nopage, + .fault = snd_usX2Y_hwdep_pcm_vm_fault, }; |