summaryrefslogtreecommitdiff
path: root/sound/usb/usx2y/usX2Yhwdep.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2007-12-13 16:16:40 +0100
committerJaroslav Kysela <perex@perex.cz>2008-01-31 17:29:32 +0100
commiteb415b8f6d1b259ea31b3093df958054380f7f8f (patch)
treebade9785fdcc99b78e5db950e5779399f071b91a /sound/usb/usx2y/usX2Yhwdep.c
parent3ad5afcd5fa91a00a9a19b9e39958acd9a3a25d7 (diff)
[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/usX2Yhwdep.c')
-rw-r--r--sound/usb/usx2y/usX2Yhwdep.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c
index b76b3dd9df25..a1dca3441319 100644
--- a/sound/usb/usx2y/usX2Yhwdep.c
+++ b/sound/usb/usx2y/usX2Yhwdep.c
@@ -34,34 +34,31 @@
int usX2Y_hwdep_pcm_new(struct snd_card *card);
-static struct page * snd_us428ctls_vm_nopage(struct vm_area_struct *area, unsigned long address, int *type)
+static int snd_us428ctls_vm_fault(struct vm_area_struct *area,
+ struct vm_fault *vmf)
{
unsigned long offset;
struct page * page;
void *vaddr;
- snd_printdd("ENTER, start %lXh, ofs %lXh, pgoff %ld, addr %lXh\n",
+ snd_printdd("ENTER, start %lXh, pgoff %ld\n",
area->vm_start,
- address - area->vm_start,
- (address - area->vm_start) >> PAGE_SHIFT,
- address);
+ vmf->pgoff);
- offset = area->vm_pgoff << PAGE_SHIFT;
- offset += address - area->vm_start;
- snd_assert((offset % PAGE_SIZE) == 0, return NOPAGE_SIGBUS);
+ offset = vmf->pgoff << PAGE_SHIFT;
vaddr = (char*)((struct usX2Ydev *)area->vm_private_data)->us428ctls_sharedmem + offset;
page = virt_to_page(vaddr);
get_page(page);
- snd_printdd( "vaddr=%p made us428ctls_vm_nopage() return %p; offset=%lX\n", vaddr, page, offset);
+ vmf->page = page;
- if (type)
- *type = VM_FAULT_MINOR;
+ snd_printdd("vaddr=%p made us428ctls_vm_fault() page %p\n",
+ vaddr, page);
- return page;
+ return 0;
}
static struct vm_operations_struct us428ctls_vm_ops = {
- .nopage = snd_us428ctls_vm_nopage,
+ .fault = snd_us428ctls_vm_fault,
};
static int snd_us428ctls_mmap(struct snd_hwdep * hw, struct file *filp, struct vm_area_struct *area)