Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp468647ybh; Tue, 10 Mar 2020 02:13:11 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsTeLRJj5zuGqkZE6eg7+ehFnt7SfDd/h9H87t6ugfeK9Nx/DnLaFSzZTHoFnAMCD8NQInb X-Received: by 2002:aca:5191:: with SMTP id f139mr432853oib.140.1583831590985; Tue, 10 Mar 2020 02:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583831590; cv=none; d=google.com; s=arc-20160816; b=thJ8QfmDdHdR1E/B9hWcmNCQAegiI1PzPePbnI0HYMGSlV5EsIJNebDC59ZLZRH2Ff qwV6V6jtwDQCoXJQIjQJ0g+dXXFBJCa2jfZnj5TK+3jDy9oCgox4+sAt43l2tGONoZja snW5dxonk4A/5oHqdKO1qkFbrj8ANeemqPQA3KVEBRp4KIKo6xuCKGi7cnwwaEQPmYgd FerBnd6sXdwNeklNnN3dnFDNKGif3PChngCuO4b2/WsjIF5Gx5JjJhPoug72ANAz8bub gOKmWFBTtBV4d4YYC4K0ZMMGhlzkiQQubUPlxUi83yLHDQ9N0FU0R5peYmC9Kibyy5TZ 1Q5w== 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=4x9IAv6prfl0vfHVE7oK0T5bkbJmzFTszJ6HAweeZGM=; b=Byc8L/qLLC9xpjoG5i4B+znNuE7B2+KVIpnfBX4nOtKi88CjJrG/Fqu0Ss/f6EaFgc X3kq08TMVZyFW74NPwWE9LRACsH8iLRv5okbz+wvrlutyP831bI9pLdrOhz5ERxgmHvE 13ZYkE7NmcCIlAO/aSlNk2bQcTx67t1C17RRjPFi/j0Vyto7ttfJFHYARkuh1ZpWJ3aX SpC/j0WyNASc/+x6gf1WOEqeh2j5AsIfYmQXQuSxtWEGUeLmbbXoUKhoG4IbqnBsNKRL OcPo8TU+vHkqSYu3OtglM5MJxlmUUY9xAutS+F2udsggQwX2BwTwyQfQUOSC4q14CC2a OSgA== 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 s27si1842779otg.229.2020.03.10.02.12.59; Tue, 10 Mar 2020 02:13:10 -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 S1726510AbgCJJMh (ORCPT + 99 others); Tue, 10 Mar 2020 05:12:37 -0400 Received: from 8bytes.org ([81.169.241.247]:50482 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbgCJJMd (ORCPT ); Tue, 10 Mar 2020 05:12:33 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id 24ECE396; Tue, 10 Mar 2020 10:12:32 +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 02/15] ACPI/IORT: Remove direct access of dev->iommu_fwspec Date: Tue, 10 Mar 2020 10:12:16 +0100 Message-Id: <20200310091229.29830-3-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 Use the accessor functions instead of directly dereferencing dev->iommu_fwspec. Tested-by: Hanjun Guo Signed-off-by: Joerg Roedel --- drivers/acpi/arm64/iort.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index ed3d2d1a7ae9..7d04424189df 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -1015,6 +1015,7 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) return ops; if (dev_is_pci(dev)) { + struct iommu_fwspec *fwspec; struct pci_bus *bus = to_pci_dev(dev)->bus; struct iort_pci_alias_info info = { .dev = dev }; @@ -1027,8 +1028,9 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) err = pci_for_each_dma_alias(to_pci_dev(dev), iort_pci_iommu_init, &info); - if (!err && iort_pci_rc_supports_ats(node)) - dev->iommu_fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; + fwspec = dev_iommu_fwspec_get(dev); + if (fwspec && iort_pci_rc_supports_ats(node)) + fwspec->flags |= IOMMU_FWSPEC_PCI_RC_ATS; } else { int i = 0; -- 2.17.1