Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp468768ybh; Tue, 10 Mar 2020 02:13:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvjbXdzruLKzxYRkscexXLnVNQVHFUFlvhNxVCOW0vPJEJ58cVFwaW+F2SspGY03WBF8eRu X-Received: by 2002:a05:6808:60f:: with SMTP id y15mr398861oih.164.1583831600376; Tue, 10 Mar 2020 02:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583831600; cv=none; d=google.com; s=arc-20160816; b=Mhf4kA8qbbRgPf5HVZSzhLmaR2mBeeE9eFja7ziBhoiABLUEWJ/CIYD9TwFfH1wTKV UipXa0CpR2O8+BOUOVMYN9fibih6GsaYXjDVr+asN6aNiBnbxsAEcpt9qL0uftJ7iyYB WG2KtvgzzDiii+F+TPofVVEwuYGnjFpOwI2DpgJU4tdCttdy+j2Niiot3dFkJ65Ox0WT yENDkiOsPvaQkf8vlLyHexYGRo+cPCt/RRxhZpWCGWSUL/Dyh4HFulq73e/nJIeA62Wh ieQetKAKmAFq2MNxeFD6cvc7ZM7w1fYAbx1z7dlzOS3SvMNW8VE6fC3sfYUk73idKXSP 4l5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=TLBBrcTDc1o/1x8EXMW53ZOwRDHwqz2l5y0sTX1BeTo=; b=FagnTaoNmt+epXJLWJi+noyliIw2/MZVo8VE8YQSRTyzwI5FigXp7cIZ77CRxZn/0g NX0cLdmdlubaz3iLru+PatfV9aYLSsZKibXGoxgo8SmzVOrxdIEIjx3Fw/lLWb33scY9 v1yuoBmhFpon0rPOXAnK1RloruKOm3LrK+oWOcDx87TjKDdqbPSU+2We5r3k3ocyiukB 72aYvQx7/tQkuUy5gk5rz1GoCpSplX36Ws7qjlc3Cx87qwGbl91epXfCL3Sjs6szsz9e gNCt64h8MYEIurKqabIdHnY3v2iETTUnaUudWKzluM8SEYSts1uWcxUE0n0rC6XWMNG9 36iA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a59si8024599otb.8.2020.03.10.02.13.08; Tue, 10 Mar 2020 02:13:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbgCJJMm (ORCPT + 99 others); Tue, 10 Mar 2020 05:12:42 -0400 Received: from 8bytes.org ([81.169.241.247]:50518 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbgCJJMg (ORCPT ); Tue, 10 Mar 2020 05:12:36 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 303657E6; Tue, 10 Mar 2020 10:12:33 +0100 (CET) From: Joerg Roedel To: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-mediatek@lists.infradead.org, virtualization@lists.linux-foundation.org, Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , Rob Clark , Sean Paul , Will Deacon , Robin Murphy , Joerg Roedel , Matthias Brugger , Thierry Reding , Jean-Philippe Brucker , Andy Gross , Bjorn Andersson , Joerg Roedel Subject: [PATCH 08/15] iommu: Introduce accessors for iommu private data Date: Tue, 10 Mar 2020 10:12:22 +0100 Message-Id: <20200310091229.29830-9-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200310091229.29830-1-joro@8bytes.org> References: <20200310091229.29830-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel Add dev_iommu_priv_get/set() functions to access per-device iommu private data. This makes it easier to move the pointer to a different location. Tested-by: Will Deacon # arm-smmu Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f5edc21a644d..056900e75758 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -627,6 +627,16 @@ static inline void dev_iommu_fwspec_set(struct device *dev, dev->iommu->fwspec = fwspec; } +static inline void *dev_iommu_priv_get(struct device *dev) +{ + return dev->iommu->fwspec->iommu_priv; +} + +static inline void dev_iommu_priv_set(struct device *dev, void *priv) +{ + dev->iommu->fwspec->iommu_priv = priv; +} + int iommu_probe_device(struct device *dev); void iommu_release_device(struct device *dev); -- 2.17.1