From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbaJYSZT (ORCPT ); Sat, 25 Oct 2014 14:25:19 -0400 Received: from smtp.citrix.com ([66.165.176.89]:58187 "EHLO SMTP.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbaJYSZQ (ORCPT ); Sat, 25 Oct 2014 14:25:16 -0400 X-IronPort-AV: E=Sophos;i="5.04,786,1406592000"; d="scan'208";a="184886129" From: Stefano Stabellini To: CC: , , , , , , Stefano Stabellini , , Subject: [PATCH v6 3/7] xen/arm: introduce is_dma_coherent Date: Sat, 25 Oct 2014 14:57:18 +0100 Message-ID: <1414245442-4306-3-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a simple utility function that returns whether a device is dma coherent based on device tree information. Signed-off-by: Stefano Stabellini CC: catalin.marinas@arm.com CC: Will.Deacon@arm.com --- arch/arm/xen/mm32.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/xen/mm32.c b/arch/arm/xen/mm32.c index 6153d61..2b259f1 100644 --- a/arch/arm/xen/mm32.c +++ b/arch/arm/xen/mm32.c @@ -2,10 +2,16 @@ #include #include #include +#include #include +static inline bool is_dma_coherent(struct device *dev) +{ + return of_dma_is_coherent(dev->of_node); +} + /* functions called by SWIOTLB */ static void dma_cache_maint(dma_addr_t handle, unsigned long offset, -- 1.7.10.4