summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-09-03 15:46:15 +0100
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-09-03 15:46:15 +0100
commit0cae5d312497b5b8e38a0d4434c878a6149d7971 (patch)
treed538dc5dc5bcead7e80dea10da4552cd9b14e1f5 /v4l/compat.h
parent73860aaa22190e1724c456b16c9bfabc19e9f497 (diff)
downloadmediapointer-dvb-s2-0cae5d312497b5b8e38a0d4434c878a6149d7971.tar.gz
mediapointer-dvb-s2-0cae5d312497b5b8e38a0d4434c878a6149d7971.tar.bz2
Remove some compat code from pwc-if, moving to compat.h
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 4c7ee52a0..17ffc7830 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -204,6 +204,16 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
return page_to_pfn(vmalloc_to_page(vmalloc_addr));
}
+static unsigned long kvirt_to_pa(unsigned long adr)
+{
+ unsigned long kva, ret;
+
+ kva = (unsigned long) page_address(vmalloc_to_page((void *)adr));
+ kva |= adr & (PAGE_SIZE-1); /* restore the offset */
+ ret = __pa(kva);
+ return ret;
+}
+
#ifndef wait_event_timeout
#define wait_event_timeout(wq, condition, timeout) \
({ \