From patchwork Mon Mar 14 13:38:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Osciak X-Patchwork-Id: 633121 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2EDcoLM011401 for ; Mon, 14 Mar 2011 13:38:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752841Ab1CNNir (ORCPT ); Mon, 14 Mar 2011 09:38:47 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:63382 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752092Ab1CNNii (ORCPT ); Mon, 14 Mar 2011 09:38:38 -0400 Received: by gyf1 with SMTP id 1so874688gyf.19 for ; Mon, 14 Mar 2011 06:38:37 -0700 (PDT) Received: by 10.151.92.17 with SMTP id u17mr5915093ybl.54.1300109917727; Mon, 14 Mar 2011 06:38:37 -0700 (PDT) Received: from localhost.localdomain (c-24-4-33-58.hsd1.ca.comcast.net [24.4.33.58]) by mx.google.com with ESMTPS id q13sm1971687yba.20.2011.03.14.06.38.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Mar 2011 06:38:37 -0700 (PDT) From: Pawel Osciak To: linux-media@vger.kernel.org Cc: m.szyprowski@samsung.com, g.liakhovetski@gmx.de, hverkuil@xs4all.nl, Pawel Osciak Subject: [PATCH 2/2] [media] videobuf2-dma-contig: make cookie() return a pointer to dma_addr_t Date: Mon, 14 Mar 2011 06:38:24 -0700 Message-Id: <1300109904-3991-2-git-send-email-pawel@osciak.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1300109904-3991-1-git-send-email-pawel@osciak.com> References: <1300109904-3991-1-git-send-email-pawel@osciak.com> 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.6 (demeter1.kernel.org [140.211.167.41]); Mon, 14 Mar 2011 13:38:50 +0000 (UTC) diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c index 90495b7..58205d5 100644 --- a/drivers/media/video/videobuf2-dma-contig.c +++ b/drivers/media/video/videobuf2-dma-contig.c @@ -78,7 +78,7 @@ static void *vb2_dma_contig_cookie(void *buf_priv) { struct vb2_dc_buf *buf = buf_priv; - return (void *)buf->paddr; + return &buf->paddr; } static void *vb2_dma_contig_vaddr(void *buf_priv) diff --git a/include/media/videobuf2-dma-contig.h b/include/media/videobuf2-dma-contig.h index 1d6188d..7e6c68b 100644 --- a/include/media/videobuf2-dma-contig.h +++ b/include/media/videobuf2-dma-contig.h @@ -14,11 +14,14 @@ #define _MEDIA_VIDEOBUF2_DMA_COHERENT_H #include +#include -static inline unsigned long vb2_dma_contig_plane_paddr( - struct vb2_buffer *vb, unsigned int plane_no) +static inline dma_addr_t +vb2_dma_contig_plane_paddr(struct vb2_buffer *vb, unsigned int plane_no) { - return (unsigned long)vb2_plane_cookie(vb, plane_no); + dma_addr_t *paddr = vb2_plane_cookie(vb, plane_no); + + return *paddr; } void *vb2_dma_contig_init_ctx(struct device *dev);