From patchwork Mon Dec 15 13:40:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 27499 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Y0VtL-00060Y-1U; Mon, 15 Dec 2014 14:40:51 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.72/mailfrontend-7) with esmtp id 1Y0VtI-00026b-17; Mon, 15 Dec 2014 14:40:50 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751351AbaLONkb (ORCPT + 1 other); Mon, 15 Dec 2014 08:40:31 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:53356 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878AbaLONka (ORCPT ); Mon, 15 Dec 2014 08:40:30 -0500 Received: from ayla.of.borg ([84.193.93.87]) by xavier.telenet-ops.be with bizsmtp id TpgU1p00e1t5w8s01pgUkt; Mon, 15 Dec 2014 14:40:29 +0100 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1Y0Vsx-0006Nc-Uj; Mon, 15 Dec 2014 14:40:28 +0100 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1Y0Vt1-0007RH-JJ; Mon, 15 Dec 2014 14:40:31 +0100 From: Geert Uytterhoeven To: Hans Verkuil , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [media] vb2-vmalloc: Protect DMA-specific code by #ifdef CONFIG_HAS_DMA Date: Mon, 15 Dec 2014 14:40:28 +0100 Message-Id: <1418650828-28562-1-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2014.12.15.132721 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_RCPTS_TO_X5 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' If NO_DMA=y: drivers/built-in.o: In function `vb2_vmalloc_dmabuf_ops_detach': videobuf2-vmalloc.c:(.text+0x6f11b0): undefined reference to `dma_unmap_sg' drivers/built-in.o: In function `vb2_vmalloc_dmabuf_ops_map': videobuf2-vmalloc.c:(.text+0x6f1266): undefined reference to `dma_unmap_sg' videobuf2-vmalloc.c:(.text+0x6f1282): undefined reference to `dma_map_sg' As we don't want to make the core VIDEOBUF2_VMALLOC depend on HAS_DMA (it's v4l2 core code, and selected by a lot of drivers), stub out the DMA support if HAS_DMA is not set. Signed-off-by: Geert Uytterhoeven Acked-by: Marek Szyprowski --- drivers/media/v4l2-core/videobuf2-vmalloc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/v4l2-core/videobuf2-vmalloc.c b/drivers/media/v4l2-core/videobuf2-vmalloc.c index fba944e502271069..d4fe55c85e0c5e71 100644 --- a/drivers/media/v4l2-core/videobuf2-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf2-vmalloc.c @@ -211,6 +211,7 @@ static int vb2_vmalloc_mmap(void *buf_priv, struct vm_area_struct *vma) return 0; } +#ifdef CONFIG_HAS_DMA /*********************************************/ /* DMABUF ops for exporters */ /*********************************************/ @@ -380,6 +381,8 @@ static struct dma_buf *vb2_vmalloc_get_dmabuf(void *buf_priv, unsigned long flag return dbuf; } +#endif /* CONFIG_HAS_DMA */ + /*********************************************/ /* callbacks for DMABUF buffers */ @@ -437,7 +440,9 @@ const struct vb2_mem_ops vb2_vmalloc_memops = { .put = vb2_vmalloc_put, .get_userptr = vb2_vmalloc_get_userptr, .put_userptr = vb2_vmalloc_put_userptr, +#ifdef CONFIG_HAS_DMA .get_dmabuf = vb2_vmalloc_get_dmabuf, +#endif .map_dmabuf = vb2_vmalloc_map_dmabuf, .unmap_dmabuf = vb2_vmalloc_unmap_dmabuf, .attach_dmabuf = vb2_vmalloc_attach_dmabuf,