From patchwork Wed Dec 12 09:23:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 13491 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 C0BCE23FD9 for ; Wed, 12 Dec 2012 09:23:27 +0000 (UTC) Received: from mail-ia0-f182.google.com (mail-ia0-f182.google.com [209.85.210.182]) by fiordland.canonical.com (Postfix) with ESMTP id 51705A18027 for ; Wed, 12 Dec 2012 09:23:27 +0000 (UTC) Received: by mail-ia0-f182.google.com with SMTP id x2so737928iad.13 for ; Wed, 12 Dec 2012 01:23:26 -0800 (PST) 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:message-id :date:from:user-agent:mime-version:to: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=WBA8UJzZwI/lFW8omxNiF8WpGS+WkZ4ZukT5sG8QQck=; b=cgOJK0osS2+Bw6mQKzs4X19lLKI6lfoK9RDlDDzzkTHc62LT6HNDOTb84f0ImA1Qcv qWMueNGHYuZXYdEXj0P0BAjVM8qTXRI4X/mnKdW+yeHj1GL1gmGm2/oEXHT50mfqToco d+u4fnwJo2TCKhw9KJFNxbdijXAbZWGAlHhFg065/h/GbZtkscvhqs8YqiHSxsgcyIQI T2Gc/6aeKhrEc7Qu9Vu+f80P5kC8Alig0v24JHXDY3OJcOY1vD9Zlcq0Fw1ahY62AJpy vDty/tD7YUbUsiNpiP4m6HGQ8RGX1JBa8mu+L9pC5Nn5za04QtMxrW0aOBJ2KZh9qSQc 7PWg== Received: by 10.50.161.169 with SMTP id xt9mr12547832igb.62.1355304206723; Wed, 12 Dec 2012 01:23:26 -0800 (PST) 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.67.148 with SMTP id n20csp187360igt; Wed, 12 Dec 2012 01:23:25 -0800 (PST) Received: by 10.204.6.20 with SMTP id 20mr190167bkx.33.1355304204826; Wed, 12 Dec 2012 01:23:24 -0800 (PST) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id hy19si35364028bkc.47.2012.12.12.01.23.08; Wed, 12 Dec 2012 01:23:24 -0800 (PST) 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 1TiiWw-0008Ce-AI; Wed, 12 Dec 2012 09:23:06 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TiiWu-0008CZ-Tw for linaro-mm-sig@lists.linaro.org; Wed, 12 Dec 2012 09:23:04 +0000 Received: from 5ed48cef.cm-7-5c.dynamic.ziggo.nl ([94.212.140.239] helo=[192.168.1.128]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TiiWu-0005v8-3q; Wed, 12 Dec 2012 09:23:04 +0000 Message-ID: <50C84CF7.7030602@canonical.com> Date: Wed, 12 Dec 2012 10:23:03 +0100 From: Maarten Lankhorst User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Sumit Semwal Cc: linaro-mm-sig@lists.linaro.org, LKML , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org Subject: [Linaro-mm-sig] [PATCH, resend] 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: ALoCoQlGhqdJngRfabg74ZzlkOetusSrxyQojQnPQV/5jXdenSoRsHWPzJY0WAbeuWKGegEgNTqE 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 --- Resubmit since it seemed to have gotten lost last cycle. 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__ */