From patchwork Thu May 14 23:00:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 6410401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A779C9F1C1 for ; Thu, 14 May 2015 23:09:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6B612044C for ; Thu, 14 May 2015 23:09:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0874F20411 for ; Thu, 14 May 2015 23:09:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yt2CR-0000Ze-5J; Thu, 14 May 2015 23:05:55 +0000 Received: from galahad.ideasonboard.com ([2001:4b98:dc2:45:216:3eff:febb:480d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yt28N-0005DK-W9 for linux-arm-kernel@lists.infradead.org; Thu, 14 May 2015 23:01:46 +0000 Received: from avalon.ideasonboard.com (dsl-hkibrasgw3-50ddcc-40.dhcp.inet.fi [80.221.204.40]) by galahad.ideasonboard.com (Postfix) with ESMTPSA id 5EB4D203B1; Fri, 15 May 2015 01:00:08 +0200 (CEST) From: Laurent Pinchart To: linux-kernel@vger.kernel.org Subject: [RFC/PATCH 7/9] iommu: of: Document the of_iommu_configure() function Date: Fri, 15 May 2015 02:00:08 +0300 Message-Id: <1431644410-2997-8-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.3.6 In-Reply-To: <1431644410-2997-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1431644410-2997-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150514_160144_562803_909E1529 X-CRM114-Status: GOOD ( 10.59 ) X-Spam-Score: -0.0 (/) Cc: Laura Abbott , Arnd Bergmann , Robin Murphy , Joreg Roedel , Will Deacon , iommu@lists.linux-foundation.org, Thierry Reding , Greg Kroah-Hartman , Grant Likely , Mitchel Humpherys , linux-arm-kernel@lists.infradead.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function isn't trivial, document its behaviour. Signed-off-by: Laurent Pinchart Acked-by: Will Deacon --- drivers/iommu/of_iommu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index 43429ab62228..b922ed4f9fb3 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -133,6 +133,19 @@ struct iommu_ops *of_iommu_get_ops(struct device_node *np) return ops; } +/** + * of_iommu_configure - Configure and return the IOMMU for a device + * @dev: device for which to configure the IOMMU + * @master_np: device node of the bus master connected to the IOMMU + * + * The master_np parameter specifies the device node of the bus master seen by + * the IOMMU. This is usually the device node of the dev device, but can be the + * device node of a bridge when the device is dynamically discovered and + * instantiated and thus has no device node (such as PCI devices for instance). + * + * Return a pointer to the iommu_ops for the device, NULL if the device isn't + * connected to an IOMMU, or a negative value if an error occurs. + */ struct iommu_ops *of_iommu_configure(struct device *dev, struct device_node *master_np) {