From patchwork Thu Mar 4 16:00:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 83626 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o24G1U7M007273 for ; Thu, 4 Mar 2010 16:01:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751876Ab0CDQBa (ORCPT ); Thu, 4 Mar 2010 11:01:30 -0500 Received: from 132.79-246-81.adsl-static.isp.belgacom.be ([81.246.79.132]:51458 "EHLO viper.mind.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751096Ab0CDQB3 (ORCPT ); Thu, 4 Mar 2010 11:01:29 -0500 Received: from [10.3.4.27] (helo=localhost.localdomain) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1NnDUN-0000tk-IO; Thu, 04 Mar 2010 17:01:28 +0100 From: Arnout Vandecappelle To: linux-media@vger.kernel.org, Sakari Ailus , mchehab@infradead.org Cc: Arnout Vandecappelle Subject: [PATCH 1/2] V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen Date: Thu, 4 Mar 2010 17:00:50 +0100 Message-Id: <1267718451-24961-2-git-send-email-arnout@mind.be> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <201003031512.45428.arnout@mind.be> References: <201003031512.45428.arnout@mind.be> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 04 Mar 2010 16:01:31 +0000 (UTC) diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index da1790e..3b6f1b8 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c @@ -244,7 +244,7 @@ int videobuf_dma_map(struct videobuf_queue* q, struct videobuf_dmabuf *dma) } if (!dma->bus_addr) { dma->sglen = dma_map_sg(q->dev, dma->sglist, - dma->nr_pages, dma->direction); + dma->sglen, dma->direction); if (0 == dma->sglen) { printk(KERN_WARNING "%s: videobuf_map_sg failed\n",__func__); @@ -262,7 +262,7 @@ int videobuf_dma_sync(struct videobuf_queue *q, struct videobuf_dmabuf *dma) MAGIC_CHECK(dma->magic, MAGIC_DMABUF); BUG_ON(!dma->sglen); - dma_sync_sg_for_cpu(q->dev, dma->sglist, dma->nr_pages, dma->direction); + dma_sync_sg_for_cpu(q->dev, dma->sglist, dma->sglen, dma->direction); return 0; } @@ -272,7 +272,7 @@ int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma) if (!dma->sglen) return 0; - dma_unmap_sg(q->dev, dma->sglist, dma->nr_pages, dma->direction); + dma_unmap_sg(q->dev, dma->sglist, dma->sglen, dma->direction); kfree(dma->sglist); dma->sglist = NULL;