From patchwork Fri Sep 28 12:41:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 11841 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 7FBC723EFD for ; Fri, 28 Sep 2012 12:42:43 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 12D6BA18A02 for ; Fri, 28 Sep 2012 12:42:42 +0000 (UTC) Received: by ieje10 with SMTP id e10so6754723iej.11 for ; Fri, 28 Sep 2012 05:42:42 -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:to:from :date:message-id:user-agent:mime-version:cc:subject:x-beenthere :x-mailman-version:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=e16DYoWowuxv1K3OxkTCJS0k9IAivFTA2NIRs14PwYc=; b=gdejbGqd3x2Z9cyP5+dke3gfiieGr9SylSUdgzy8ikPNf6qif9PFjaQsJYQXQ8Y50b jtldeh8CkfHGjgsIMcaIaJ4sWPcdrSRpMJUX/xxbqzkJOy5QS4kYKSCtafAESdbXlQPO gGQyHJLeWQD/t2t9PknJtXFLMbg7yRF5ODQwkKouhg6ZzFBU1a1PE3BbcaX66FxQs5+q N2S6HWmxEQThb9wLydOv/A03UC6ahY1XnRtcnl8YNh8srShMwM5UrhlCO+6RerPw6hG5 jZIo7tJQDtIesT/P5qiPp3R7ImpRwRjj/BxdqDVJFaO/5GKNgAk/p8335SnsEuKaOUEc +RUg== Received: by 10.42.84.69 with SMTP id k5mr5528709icl.5.1348836162296; Fri, 28 Sep 2012 05:42:42 -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.232 with SMTP id ex8csp469922igc; Fri, 28 Sep 2012 05:42:41 -0700 (PDT) Received: by 10.216.200.163 with SMTP id z35mr3309410wen.53.1348836160065; Fri, 28 Sep 2012 05:42:40 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id w2si23113955wiz.30.2012.09.28.05.42.36; Fri, 28 Sep 2012 05:42:40 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1THZto-0007or-DN; Fri, 28 Sep 2012 12:42:32 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1THZtm-0007oF-PY for linaro-mm-sig@lists.linaro.org; Fri, 28 Sep 2012 12:42:30 +0000 Received: from lillypilly.canonical.com ([91.189.89.62]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1THZtk-00046n-Ou; Fri, 28 Sep 2012 12:42:28 +0000 Received: by lillypilly.canonical.com (Postfix, from userid 3489) id 26BB326C255C; Fri, 28 Sep 2012 12:41:52 +0000 (UTC) To: jakob@vmware.com, thellstrom@vmware.com, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org From: Maarten Lankhorst Date: Fri, 28 Sep 2012 14:41:48 +0200 Message-ID: <20120928124148.14366.21063.stgit@patser.local> User-Agent: StGit/0.15 MIME-Version: 1.0 Cc: linux-kernel@vger.kernel.org Subject: [Linaro-mm-sig] [PATCH 1/5] dma-buf: remove fallback for !CONFIG_DMA_SHARED_BUFFER X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQl46yRj0zYvAt9Vu6+8fuvpOmygnbXQTGJ3BPQ0BMfUsjEYYZuCYSNEElnWM1Nz45P0Pkl7 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 --- 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__ */