summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2014-03-08 10:09:29 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-25 11:17:37 -0300
commit9a8c7fffa2293417d0245fb9f618564d7dee04a6 (patch)
treee31338b1d46dfccdc69cf88192945a12d63ae4a0 /drivers/media
parent49ac3695d08698c19d2b23af6bd0dd1dfd1a10af (diff)
downloadlinux-9a8c7fffa2293417d0245fb9f618564d7dee04a6.tar.bz2
[media] omap3isp: queue: Use sg_alloc_table_from_pages()
Replace the custom implementation with a call to the scatterlist helper function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/omap3isp/ispqueue.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/media/platform/omap3isp/ispqueue.c b/drivers/media/platform/omap3isp/ispqueue.c
index 4a271c7a2cf5..cee1b5d29cfa 100644
--- a/drivers/media/platform/omap3isp/ispqueue.c
+++ b/drivers/media/platform/omap3isp/ispqueue.c
@@ -233,12 +233,10 @@ static void isp_video_buffer_cleanup(struct isp_video_buffer *buf)
*/
static int isp_video_buffer_prepare_user(struct isp_video_buffer *buf)
{
- struct scatterlist *sg;
unsigned int offset;
unsigned long data;
unsigned int first;
unsigned int last;
- unsigned int i;
int ret;
data = buf->vbuf.m.userptr;
@@ -267,21 +265,11 @@ static int isp_video_buffer_prepare_user(struct isp_video_buffer *buf)
if (ret < 0)
return ret;
- ret = sg_alloc_table(&buf->sgt, buf->npages, GFP_KERNEL);
+ ret = sg_alloc_table_from_pages(&buf->sgt, buf->pages, buf->npages,
+ offset, buf->vbuf.length, GFP_KERNEL);
if (ret < 0)
return ret;
- for (sg = buf->sgt.sgl, i = 0; i < buf->npages; ++i) {
- if (PageHighMem(buf->pages[i])) {
- sg_free_table(&buf->sgt);
- return -EINVAL;
- }
-
- sg_set_page(sg, buf->pages[i], PAGE_SIZE - offset, offset);
- sg = sg_next(sg);
- offset = 0;
- }
-
return 0;
}