Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8449117imu; Tue, 4 Dec 2018 08:31:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/WMtx20W0BrBxEJrMrN0XXrL/9ONY6K/CydGFoJGC8w61Iclsigy3hwlAWkQJNCvHXdVX2/ X-Received: by 2002:a62:59c9:: with SMTP id k70mr20580397pfj.243.1543941113613; Tue, 04 Dec 2018 08:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543941113; cv=none; d=google.com; s=arc-20160816; b=lhT43FqLruotZdUzTZPl+h3o1fXf7ORXxbcgPKFO6fpGeEpKEoLXWRm85ysQehCWyq +vbbmJsObQ/gVw6KzPqpghszWOJIe2YV7rKFGRKsLMXsGvdO269Z+F24MpV4xPH63OFH EL68L4+2Bg+edY32vNacALYmji5FWRoLkZFTZ/QvQirO5fMwAVxy/rOOfpeZsf6XTlvq +Tw+m0MlRzcVqQlQ+X0+YkIu4Ur+s1Te8PaYtOu7sbL3+DPev7W5TmoVEJt5+Hd/Fnev 4uDolQUH5a9PezEo+h/ZSJxfhq2/pkWPYZ3QBLZDHBWErPWC2gF5OzgYIJzAYxKfLPiL YRNQ== 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=Qj4J8sKm2mvWwysKWzrnQ147dEQYTpkqCdHKZ1HbA34=; b=RSr8AuQA++HQZM6brB2eo4lSjoyozNGONuoJEQmsec3PQtxUyf0OWc+Sae3ZnD/098 lwJiEp51Tvu4GNOJP85Fz+/9O+El/6ZydtAXF89032JeF0MJajMPsLvy9eNx80iCv+ng 1t6Tp42k6f4jcQ8zwciaTciH4WYepmUpqBD/8Y9JZOf4puYzz7m03dvSKJ4hV7aN/AmI PwChAT7WfL/JzIqDDo52IAgDbWWdQFCU3AX8aO1Y6Honk2tOZq92issSBRcNa0dLOwNB qerEBmMlk6K1qM8vYidQmTPCi6ZTMbp7EMzvXMKM3ak8yDZwnsvGkr5GOx/f7MNI+2j/ TDoQ== 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 89si18459364pfr.242.2018.12.04.08.31.25; Tue, 04 Dec 2018 08:31:53 -0800 (PST) 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 S1727181AbeLDQa2 (ORCPT + 99 others); Tue, 4 Dec 2018 11:30:28 -0500 Received: from 8bytes.org ([81.169.241.247]:51518 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbeLDQaH (ORCPT ); Tue, 4 Dec 2018 11:30:07 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 407C9451; Tue, 4 Dec 2018 17:30:05 +0100 (CET) From: Joerg Roedel To: iommu@lists.linux-foundation.org Cc: Robin Murphy , linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 7/9] iommu/of: Use helper functions to access dev->iommu_fwspec Date: Tue, 4 Dec 2018 17:30:00 +0100 Message-Id: <20181204163002.15800-8-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181204163002.15800-1-joro@8bytes.org> References: <20181204163002.15800-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 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 --- 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