From patchwork Fri Aug 10 14:57:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 10683 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AC4B923E41 for ; Fri, 10 Aug 2012 14:57:49 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 57194A18BCF for ; Fri, 10 Aug 2012 14:57:48 +0000 (UTC) Received: by ggnf1 with SMTP id f1so1670513ggn.11 for ; Fri, 10 Aug 2012 07:57:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:subject:to :from:cc:date:message-id:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=FTjk48Zw0MN6HDoiPwIOFf41aOenBg//iDcxCVPK1iw=; b=RLO667LlD2R6foKMff6sn4QI8vROg35N6hnCyoyHV/rqSvt3lcv+KfaGRt8NtoMcjU ktpzO1faR+q1goRA4BjQ0W547pW/aWvt8ahunzXmDXeRFAD1QIxh+Wcam6M+Idlqjgzd D/V3bpeIRZ6jGa35ao/PISNTusGE+UVkOl6+Ono7O/6qBOsQpbPp5Sv9qFPazUrT4j79 Bb8nIMWUhoNiCuM+Q3fEGXtDmLRhBK7OHGlXB5p++DmH/AtsWUGFf6x+CGmWcYrGWVy3 0hi1WSdhoxDuHVG/igvuFQQj1bLknLomLdE8Xm4F4nz8SPNoyPdZxC/VxJQrPWpCYzel QthA== Received: by 10.50.181.136 with SMTP id dw8mr2074910igc.31.1344610668182; Fri, 10 Aug 2012 07:57:48 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.200 with SMTP id ew8csp65140igc; Fri, 10 Aug 2012 07:57:47 -0700 (PDT) Received: by 10.180.81.193 with SMTP id c1mr6711983wiy.12.1344610666847; Fri, 10 Aug 2012 07:57:46 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com. [91.189.90.139]) by mx.google.com with ESMTP id r9si10356796wic.46.2012.08.10.07.57.46; Fri, 10 Aug 2012 07:57:46 -0700 (PDT) Received-SPF: pass (google.com: domain of mlankhorst@lillypilly.canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mlankhorst@lillypilly.canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=mlankhorst@lillypilly.canonical.com Received: from lillypilly.canonical.com ([91.189.89.62]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1Szqen-0006QP-Cz; Fri, 10 Aug 2012 14:57:45 +0000 Received: by lillypilly.canonical.com (Postfix, from userid 3489) id 4B6EA26C26C6; Fri, 10 Aug 2012 14:57:45 +0000 (UTC) Subject: [PATCH 1/4] dma-buf: remove fallback for !CONFIG_DMA_SHARED_BUFFER To: sumit.semwal@linaro.org, rob.clark@linaro.org From: Maarten Lankhorst Cc: linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, patches@linaro.org Date: Fri, 10 Aug 2012 16:57:43 +0200 Message-ID: <20120810145728.5490.44707.stgit@patser.local> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlx4Awce6dXzj1egApBI1FN/Gk3EoSB5+dEHPIFlGPBz2e8ioUCpwrO3X9zhKLtjejZ1+Jm Documentation says that code requiring dma-buf should add it to select, so inline fallbacks are not going to be used. A link error will make it obvious what went wrong, instead of silently doing nothing at runtime. Signed-off-by: Maarten Lankhorst Reviewed-by: Daniel Vetter Reviewed-by: Rob Clark --- include/linux/dma-buf.h | 99 ----------------------------------------------- 1 file changed, 99 deletions(-) diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index eb48f38..bd2e52c 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -156,7 +156,6 @@ static inline void get_dma_buf(struct dma_buf *dmabuf) get_file(dmabuf->file); } -#ifdef CONFIG_DMA_SHARED_BUFFER struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, struct device *dev); void dma_buf_detach(struct dma_buf *dmabuf, @@ -184,103 +183,5 @@ int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *, unsigned long); void *dma_buf_vmap(struct dma_buf *); void dma_buf_vunmap(struct dma_buf *, void *vaddr); -#else - -static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf, - struct device *dev) -{ - return ERR_PTR(-ENODEV); -} - -static inline void dma_buf_detach(struct dma_buf *dmabuf, - struct dma_buf_attachment *dmabuf_attach) -{ - return; -} - -static inline struct dma_buf *dma_buf_export(void *priv, - const struct dma_buf_ops *ops, - size_t size, int flags) -{ - return ERR_PTR(-ENODEV); -} - -static inline int dma_buf_fd(struct dma_buf *dmabuf, int flags) -{ - return -ENODEV; -} - -static inline struct dma_buf *dma_buf_get(int fd) -{ - return ERR_PTR(-ENODEV); -} - -static inline void dma_buf_put(struct dma_buf *dmabuf) -{ - return; -} - -static inline struct sg_table *dma_buf_map_attachment( - struct dma_buf_attachment *attach, enum dma_data_direction write) -{ - return ERR_PTR(-ENODEV); -} - -static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach, - struct sg_table *sg, enum dma_data_direction dir) -{ - return; -} - -static inline int dma_buf_begin_cpu_access(struct dma_buf *dmabuf, - size_t start, size_t len, - enum dma_data_direction dir) -{ - return -ENODEV; -} - -static inline void dma_buf_end_cpu_access(struct dma_buf *dmabuf, - size_t start, size_t len, - enum dma_data_direction dir) -{ -} - -static inline void *dma_buf_kmap_atomic(struct dma_buf *dmabuf, - unsigned long pnum) -{ - return NULL; -} - -static inline void dma_buf_kunmap_atomic(struct dma_buf *dmabuf, - unsigned long pnum, void *vaddr) -{ -} - -static inline void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long pnum) -{ - return NULL; -} - -static inline void dma_buf_kunmap(struct dma_buf *dmabuf, - unsigned long pnum, void *vaddr) -{ -} - -static inline int dma_buf_mmap(struct dma_buf *dmabuf, - struct vm_area_struct *vma, - unsigned long pgoff) -{ - return -ENODEV; -} - -static inline void *dma_buf_vmap(struct dma_buf *dmabuf) -{ - return NULL; -} - -static inline void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr) -{ -} -#endif /* CONFIG_DMA_SHARED_BUFFER */ #endif /* __DMA_BUF_H__ */