Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp468965ybh; Tue, 10 Mar 2020 02:13:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vss2Th+pnMa9KMntYR/B8qWS+Kl1S0K/5B9mnDAwfk2sk1CFBrJpcb6PX+sAw6K1SfQxvyi X-Received: by 2002:aca:5194:: with SMTP id f142mr433480oib.100.1583831613037; Tue, 10 Mar 2020 02:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583831613; cv=none; d=google.com; s=arc-20160816; b=tyUO/BHePiFfZtx15sbDeA45dULd5NNWUIfzOYyXXfHNUfOy6Bh3TujJ9s1T3+SOgv gKlqLl8Ul4yphfn8AdeVIetLGlnsF+Y71oDvJTLk9IQIMge96V+rsZygAoAURvcZYqz/ 4j6Wz4Q6vxjdL8mG4eQjHCV/iD1mYEiNcZpa/N4tYtgZAWr0fGOWsF4Rr+A2subEw9Sk BykQTL5s1CjD+MiccZL9/Ua5mBc4+MqVpcDiD2HHAqnD9s5U/iPVGvP4YXqvUCYv3WJV IccK0tjEvFePEwemXkGPOq+Rr+odayLiYDKTS8Od/+aRjt10tYs0y1NdRxjmRh059EG5 eUYw== 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=UOS0lb5jsnaXDuyDktfFOxM1P2rwolXJrtjZbYvjpnY=; b=0v7OmZmibtMbFbUuEQQVEyoyWj+tCD3tege+B/GjglHMIxQVFqV4lqn0t8dOGWs970 +Pk5vgNO/nNgpmdbiToLqFE/+1g4dlqrTKtX1UNOdppJQPsDAxy5K2KrtWRA7AvbimYo 9Oy1w7ndDRS+p5awi5XXb68Fjb+aCtssRXVfveXA/TItFk8elDx/aMdSRPdVPuCt00lR sAkFPux0l+jLKhkLUIoCmpaVrKc3KeTWLUaJ2TrawdvSCdTIp8bpdcFheC4igu6mpsfL rhwX5XJ2tSthG6qoKMYJ/i3Rr69EuPM9fJA0vfVZPqPpI76GCxZz271JV8gvw8Vv4JHx YZDw== 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 64si1625888otn.4.2020.03.10.02.13.20; Tue, 10 Mar 2020 02:13:33 -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 S1726756AbgCJJMu (ORCPT + 99 others); Tue, 10 Mar 2020 05:12:50 -0400 Received: from 8bytes.org ([81.169.241.247]:50558 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgCJJMi (ORCPT ); Tue, 10 Mar 2020 05:12:38 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 568BEE06; Tue, 10 Mar 2020 10:12:34 +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 14/15] iommu/virtio: Use accessor functions for iommu private data Date: Tue, 10 Mar 2020 10:12:28 +0100 Message-Id: <20200310091229.29830-15-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 Make use of dev_iommu_priv_set/get() functions. Signed-off-by: Joerg Roedel --- drivers/iommu/virtio-iommu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index cce329d71fba..8ead57f031f5 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -466,7 +466,7 @@ static int viommu_probe_endpoint(struct viommu_dev *viommu, struct device *dev) struct virtio_iommu_req_probe *probe; struct virtio_iommu_probe_property *prop; struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); - struct viommu_endpoint *vdev = fwspec->iommu_priv; + struct viommu_endpoint *vdev = dev_iommu_priv_get(dev); if (!fwspec->num_ids) return -EINVAL; @@ -648,7 +648,7 @@ static int viommu_attach_dev(struct iommu_domain *domain, struct device *dev) int ret = 0; struct virtio_iommu_req_attach req; struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); - struct viommu_endpoint *vdev = fwspec->iommu_priv; + struct viommu_endpoint *vdev = dev_iommu_priv_get(dev); struct viommu_domain *vdomain = to_viommu_domain(domain); mutex_lock(&vdomain->mutex); @@ -807,8 +807,7 @@ static void viommu_iotlb_sync(struct iommu_domain *domain, static void viommu_get_resv_regions(struct device *dev, struct list_head *head) { struct iommu_resv_region *entry, *new_entry, *msi = NULL; - struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev); - struct viommu_endpoint *vdev = fwspec->iommu_priv; + struct viommu_endpoint *vdev = dev_iommu_priv_get(dev); int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO; list_for_each_entry(entry, &vdev->resv_regions, list) { @@ -876,7 +875,7 @@ static int viommu_add_device(struct device *dev) vdev->dev = dev; vdev->viommu = viommu; INIT_LIST_HEAD(&vdev->resv_regions); - fwspec->iommu_priv = vdev; + dev_iommu_priv_set(dev, vdev); if (viommu->probe_size) { /* Get additional information for this endpoint */ @@ -920,7 +919,7 @@ static void viommu_remove_device(struct device *dev) if (!fwspec || fwspec->ops != &viommu_ops) return; - vdev = fwspec->iommu_priv; + vdev = dev_iommu_priv_get(dev); iommu_group_remove_device(dev); iommu_device_unlink(&vdev->viommu->iommu, dev); -- 2.17.1