From patchwork Tue Aug 5 10:47:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 34923 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f70.google.com (mail-qg0-f70.google.com [209.85.192.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB31420523 for ; Tue, 5 Aug 2014 10:49:58 +0000 (UTC) Received: by mail-qg0-f70.google.com with SMTP id z60sf2188300qgd.1 for ; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=JdkMyA/LjDzOYY8uUeTuAu67643AN4m2CrUUgWIOA6A=; b=GeMYHXSo3q5qYGvD1q5sdebKt0MYkgIuuNUJ6ptB79A4jJyGgR+EvvsTTb2ej4eTbU CZdZ3jiYjHup682aHKdyBdc3gbEVucwOT2Tx+LCJ1RwaujODGX5PObRLtAKLUZmnm6Qn SPgNwl/Ii3oNBBfIrRsLCixX3VVKbcP+qOvp8xQSybj9IF2abqwuueLWLLDfZJvM3n5e 4jAuVItUMTH3w2tT6YVFFCVZwoS9CtFB1af7KuOjkoy7YRyYQWkUpoAeSsB+xDm9yqYl bSupSWxUAc7snwh66YwuAWN4ETGCYmcMzHYuzvgPsL/hI/pY+PouyotI7dbvEBfvPJD+ tlGQ== X-Gm-Message-State: ALoCoQmwhyXSM6oWzhmO6o4/hwwv3wlGDJI3rPC0sRbQQU+xT2EGE3BueqV0I73PFPZmHuk/49DZ X-Received: by 10.236.39.165 with SMTP id d25mr1596830yhb.2.1407235798789; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.50.227 with SMTP id s90ls183101qga.95.gmail; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) X-Received: by 10.52.163.229 with SMTP id yl5mr319785vdb.79.1407235798669; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id t1si776913vcx.69.2014.08.05.03.49.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:49:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ik5so1091467vcb.6 for ; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) X-Received: by 10.221.47.9 with SMTP id uq9mr1019869vcb.48.1407235798604; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp374606vcb; Tue, 5 Aug 2014 03:49:58 -0700 (PDT) X-Received: by 10.229.74.74 with SMTP id t10mr4387527qcj.12.1407235798123; Tue, 05 Aug 2014 03:49:58 -0700 (PDT) Received: from ip-10-141-164-156.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id w37si2149493qgw.65.2014.08.05.03.49.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 03:49:58 -0700 (PDT) Received-SPF: none (google.com: linaro-mm-sig-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-141-164-156.ec2.internal) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEcJZ-0005MW-2K; Tue, 05 Aug 2014 10:49:57 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by ip-10-141-164-156.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XEcId-0005Ef-GZ for linaro-mm-sig@lists.linaro.org; Tue, 05 Aug 2014 10:48:59 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9T00DKGY1F7Y00@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 05 Aug 2014 11:48:51 +0100 (BST) X-AuditID: cbfec7f5-b7f776d000003e54-8c-53e0b6987267 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id F2.DC.15956.896B0E35; Tue, 05 Aug 2014 11:48:56 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N9T0057MY17SE80@eusync3.samsung.com>; Tue, 05 Aug 2014 11:48:56 +0100 (BST) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Tue, 05 Aug 2014 12:47:37 +0200 Message-id: <1407235677-26324-10-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> References: <1407235677-26324-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsVy+t/xq7oztj0INji3UM/i76Rj7BbNi9ez WUy6P4HFYsF+a4vO2RvYLXoXXGWzONv0ht2ic+ISdosvVx4yWWx6fI3V4vKuOWwWM87vY7JY e+Quu8Wp65/ZLP71HmS0OHP6EqvF/z072C0Ov2lntTjycDe7xapdfxgtbv/mcxD1eHJwHpPH 71+TGD12zrrL7jG7Yyarx6ZVnWwe++euYffYvKTe4/a/x8wek28sZ/S4cqKJ1aO3+R2bx5ar 7SwefVtWMXp83iQXwBfFZZOSmpNZllqkb5fAldHV+oqt4Dhvxb3Gr0wNjBu5uxg5OSQETCQm ff3ECGGLSVy4t56ti5GLQ0hgKaPE3IWPmCCcPiaJy7v+M4FUsQkYSnS97QKrEhHoZZTob/oB VsUssI5VYn/vdRaQKmGBJInub01gc1kEVCX2H17LDGLzCnhKPPtxigVin5zE/5crwKZyAsUP 3zzACmILCXhI/Nywhn0CI+8CRoZVjKKppckFxUnpuUZ6xYm5xaV56XrJ+bmbGCGx83UH49Jj VocYBTgYlXh4FfbeDRZiTSwrrsw9xCjBwawkwiux5kGwEG9KYmVValF+fFFpTmrxIUYmDk6p BsYN7tcmB6y0eXambe9/9QleURxcAo9Tlm/lehMV/fyzm2ua4GUlsXNpu39s7VuckHzsEvNC yWWiFt+kPNdc1/73fGvYt5OS9xo7Elr4HGweJcyp5j1fc8At7ce8benSgX+9/xQ4/nr1ONM+ +piqlemttzPfX79R4NbS3/pohsmfT46rKuLXtK5QYinOSDTUYi4qTgQAM+KJbHsCAAA= Cc: Rob Herring , Thierry Reding , Shaik Ameer Basha , Arnd Bergmann , Inki Dae , Greg Kroah-Hartman , Joerg Roedel , "Rafael J. Wysocki" , Tomasz Figa , linaro-mm-sig@lists.linaro.org, Kyungmin Park , Kukjin Kim , Laurent Pinchart , Sylwester Nawrocki , Olof Johansson , Cho KyongHo Subject: [Linaro-mm-sig] [PATCH 09/29] ARM: dma-mapping: provide stubs if no ARM_DMA_USE_IOMMU has been selected X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: linaro-mm-sig-bounces@lists.linaro.org Sender: linaro-mm-sig-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This patch provides stubs returing errors for all iommu related arm dma-mapping functions, which are used when CONFIG_ARM_DMA_USE_IOMMU is not set. This let drivers to use common code for iommu and non-iommu cases without additional ifdefs. Signed-off-by: Marek Szyprowski --- arch/arm/include/asm/dma-iommu.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/include/asm/dma-iommu.h b/arch/arm/include/asm/dma-iommu.h index ae3dac0..1e57569 100644 --- a/arch/arm/include/asm/dma-iommu.h +++ b/arch/arm/include/asm/dma-iommu.h @@ -9,6 +9,8 @@ #include #include +#ifdef CONFIG_ARM_DMA_USE_IOMMU + struct dma_iommu_mapping { /* iommu specific data */ struct iommu_domain *domain; @@ -38,5 +40,34 @@ int arm_iommu_create_default_mapping(struct device *dev, dma_addr_t base, void arm_iommu_release_default_mapping(struct device *dev); +#else + +static inline struct dma_iommu_mapping * +arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) +{ + return ERR_PTR(-ENOSYS); +} + +static inline void +arm_iommu_release_mapping(struct dma_iommu_mapping *mapping) { } + +static inline int arm_iommu_attach_device(struct device *dev, + struct dma_iommu_mapping *mapping) +{ + return -ENOSYS; +} + +static inline void arm_iommu_detach_device(struct device *dev) { } + +static inline int arm_iommu_create_default_mapping(struct device *dev, + dma_addr_t base, size_t size) +{ + return -ENOSYS; +} + +static inline void arm_iommu_release_default_mapping(struct device *dev) { } + +#endif + #endif /* __KERNEL__ */ #endif