public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: iommu@lists.linux-foundation.org
Cc: Robin Murphy <robin.murphy@arm.com>,
	linux-kernel@vger.kernel.org, Joerg Roedel <jroedel@suse.de>
Subject: [PATCH 7/9] iommu/of: Use helper functions to access dev->iommu_fwspec
Date: Tue,  4 Dec 2018 17:30:00 +0100	[thread overview]
Message-ID: <20181204163002.15800-8-joro@8bytes.org> (raw)
In-Reply-To: <20181204163002.15800-1-joro@8bytes.org>

From: Joerg Roedel <jroedel@suse.de>

Use the new helpers dev_iommu_fwspec_get()/set() to access
the dev->iommu_fwspec pointer. This makes it easier to move
that pointer later into another struct.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/of_iommu.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index c5dd63072529..38232250b5f4 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -164,7 +164,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
 					   struct device_node *master_np)
 {
 	const struct iommu_ops *ops = NULL;
-	struct iommu_fwspec *fwspec = dev->iommu_fwspec;
+	struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
 	int err = NO_IOMMU;
 
 	if (!master_np)
@@ -208,6 +208,9 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
 		}
 	}
 
+	/* The fwspec pointer changed, read it again */
+	fwspec = dev_iommu_fwspec_get(dev);
+
 	/*
 	 * Two success conditions can be represented by non-negative err here:
 	 * >0 : there is no IOMMU, or one was unavailable for non-fatal reasons
@@ -215,7 +218,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev,
 	 * <0 : any actual error
 	 */
 	if (!err)
-		ops = dev->iommu_fwspec->ops;
+		ops = fwspec->ops;
 	/*
 	 * If we have reason to believe the IOMMU driver missed the initial
 	 * add_device callback for dev, replay it to get things in order.
-- 
2.17.1


  parent reply	other threads:[~2018-12-04 16:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 16:29 [PATCH 0/9] Access dev->iommu_fwspec through functions Joerg Roedel
2018-12-04 16:29 ` [PATCH 1/9] iommu: Introduce wrappers around dev->iommu_fwspec Joerg Roedel
2018-12-04 16:29 ` [PATCH 2/9] ACPI/IORT: Use helper functions to access dev->iommu_fwspec Joerg Roedel
2018-12-05 17:50   ` Robin Murphy
2018-12-06 13:53     ` Joerg Roedel
2018-12-04 16:29 ` [PATCH 3/9] iommu/arm-smmu: " Joerg Roedel
2018-12-06 13:11   ` Will Deacon
2018-12-04 16:29 ` [PATCH 4/9] iommu/dma: " Joerg Roedel
2018-12-04 16:29 ` [PATCH 5/9] iommu/ipmmu-vmsa: " Joerg Roedel
2018-12-04 16:29 ` [PATCH 6/9] iommu/mediatek: " Joerg Roedel
2018-12-04 16:30 ` Joerg Roedel [this message]
2018-12-05 17:41   ` [PATCH 7/9] iommu/of: " Robin Murphy
2018-12-06 14:16     ` Joerg Roedel
2018-12-04 16:30 ` [PATCH 8/9] iommu/qcom: " Joerg Roedel
2018-12-04 16:30 ` [PATCH 9/9] iommu/tegra: " Joerg Roedel
  -- strict thread matches above, loose matches on Subject: below --
2018-12-11 12:19 [PATCH 0/9 v2] Access dev->iommu_fwspec through functions Joerg Roedel
2018-12-11 12:19 ` [PATCH 7/9] iommu/of: Use helper functions to access dev->iommu_fwspec Joerg Roedel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181204163002.15800-8-joro@8bytes.org \
    --to=joro@8bytes.org \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox