diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-03-08 08:09:29 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-25 10:17:37 -0400 |
commit | 9a8c7fffa2293417d0245fb9f618564d7dee04a6 (patch) | |
tree | e31338b1d46dfccdc69cf88192945a12d63ae4a0 /drivers/media | |
parent | 49ac3695d08698c19d2b23af6bd0dd1dfd1a10af (diff) |
[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.c | 16 |
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) | |||
233 | */ | 233 | */ |
234 | static int isp_video_buffer_prepare_user(struct isp_video_buffer *buf) | 234 | static int isp_video_buffer_prepare_user(struct isp_video_buffer *buf) |
235 | { | 235 | { |
236 | struct scatterlist *sg; | ||
237 | unsigned int offset; | 236 | unsigned int offset; |
238 | unsigned long data; | 237 | unsigned long data; |
239 | unsigned int first; | 238 | unsigned int first; |
240 | unsigned int last; | 239 | unsigned int last; |
241 | unsigned int i; | ||
242 | int ret; | 240 | int ret; |
243 | 241 | ||
244 | data = buf->vbuf.m.userptr; | 242 | data = buf->vbuf.m.userptr; |
@@ -267,21 +265,11 @@ static int isp_video_buffer_prepare_user(struct isp_video_buffer *buf) | |||
267 | if (ret < 0) | 265 | if (ret < 0) |
268 | return ret; | 266 | return ret; |
269 | 267 | ||
270 | ret = sg_alloc_table(&buf->sgt, buf->npages, GFP_KERNEL); | 268 | ret = sg_alloc_table_from_pages(&buf->sgt, buf->pages, buf->npages, |
269 | offset, buf->vbuf.length, GFP_KERNEL); | ||
271 | if (ret < 0) | 270 | if (ret < 0) |
272 | return ret; | 271 | return ret; |
273 | 272 | ||
274 | for (sg = buf->sgt.sgl, i = 0; i < buf->npages; ++i) { | ||
275 | if (PageHighMem(buf->pages[i])) { | ||
276 | sg_free_table(&buf->sgt); | ||
277 | return -EINVAL; | ||
278 | } | ||
279 | |||
280 | sg_set_page(sg, buf->pages[i], PAGE_SIZE - offset, offset); | ||
281 | sg = sg_next(sg); | ||
282 | offset = 0; | ||
283 | } | ||
284 | |||
285 | return 0; | 273 | return 0; |
286 | } | 274 | } |
287 | 275 | ||