summaryrefslogtreecommitdiff
path: root/drivers/media/video/em28xx/em28xx-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c54
1 files changed, 7 insertions, 47 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index 9f6e5e5355a1..e8a1c2247567 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -39,7 +39,7 @@ MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
#define em28xx_coredbg(fmt, arg...) do {\
if (core_debug) \
printk(KERN_INFO "%s %s :"fmt, \
- dev->name, __FUNCTION__ , ##arg); } while (0)
+ dev->name, __FUNCTION__, ##arg); } while (0)
static unsigned int reg_debug;
module_param(reg_debug,int,0644);
@@ -48,7 +48,7 @@ MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]");
#define em28xx_regdbg(fmt, arg...) do {\
if (reg_debug) \
printk(KERN_INFO "%s %s :"fmt, \
- dev->name, __FUNCTION__ , ##arg); } while (0)
+ dev->name, __FUNCTION__, ##arg); } while (0)
static unsigned int isoc_debug;
module_param(isoc_debug,int,0644);
@@ -57,7 +57,7 @@ MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]");
#define em28xx_isocdbg(fmt, arg...) do {\
if (isoc_debug) \
printk(KERN_INFO "%s %s :"fmt, \
- dev->name, __FUNCTION__ , ##arg); } while (0)
+ dev->name, __FUNCTION__, ##arg); } while (0)
static int alt = EM28XX_PINOUT;
module_param(alt, int, 0644);
@@ -116,47 +116,6 @@ void em28xx_print_ioctl(char *name, unsigned int cmd)
}
}
-static void *rvmalloc(size_t size)
-{
- void *mem;
- unsigned long adr;
-
- size = PAGE_ALIGN(size);
-
- mem = vmalloc_32((unsigned long)size);
- if (!mem)
- return NULL;
-
- memset(mem, 0, size);
-
- adr = (unsigned long)mem;
- while (size > 0) {
- SetPageReserved(vmalloc_to_page((void *)adr));
- adr += PAGE_SIZE;
- size -= PAGE_SIZE;
- }
-
- return mem;
-}
-
-static void rvfree(void *mem, size_t size)
-{
- unsigned long adr;
-
- if (!mem)
- return;
-
- size = PAGE_ALIGN(size);
-
- adr = (unsigned long)mem;
- while (size > 0) {
- ClearPageReserved(vmalloc_to_page((void *)adr));
- adr += PAGE_SIZE;
- size -= PAGE_SIZE;
- }
-
- vfree(mem);
-}
/*
* em28xx_request_buffers()
@@ -173,8 +132,10 @@ u32 em28xx_request_buffers(struct em28xx *dev, u32 count)
dev->num_frames = count;
while (dev->num_frames > 0) {
- if ((buff = rvmalloc(dev->num_frames * imagesize)))
+ if ((buff = vmalloc_32(dev->num_frames * imagesize))) {
+ memset(buff, 0, dev->num_frames * imagesize);
break;
+ }
dev->num_frames--;
}
@@ -217,8 +178,7 @@ void em28xx_queue_unusedframes(struct em28xx *dev)
void em28xx_release_buffers(struct em28xx *dev)
{
if (dev->num_frames) {
- rvfree(dev->frame[0].bufmem,
- dev->num_frames * PAGE_ALIGN(dev->frame[0].buf.length));
+ vfree(dev->frame[0].bufmem);
dev->num_frames = 0;
}
}