From 0cae5d312497b5b8e38a0d4434c878a6149d7971 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 3 Sep 2007 15:46:15 +0100 Subject: Remove some compat code from pwc-if, moving to compat.h From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'v4l/compat.h') 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) \ ({ \ -- cgit v1.2.3