From patchwork Thu Sep 21 00:37:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Goel, Sameer" X-Patchwork-Id: 9963105 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1BC8D6056D for ; Thu, 21 Sep 2017 00:39:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DD5A2927D for ; Thu, 21 Sep 2017 00:39:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02AC529280; Thu, 21 Sep 2017 00:39:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 30CB22927F for ; Thu, 21 Sep 2017 00:39:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dupUd-0000FO-7r; Thu, 21 Sep 2017 00:37:27 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dupUc-0000F8-1x for xen-devel@lists.xenproject.org; Thu, 21 Sep 2017 00:37:26 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id 1F/17-02046-5C903C95; Thu, 21 Sep 2017 00:37:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsVybKJsgu4RzsO RBnc/KFl83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkfH3IXLBWsuLR8EVsD42m+LkZODiGBIolp T+8wdTFycbAINDBLnN52iB0kISEQLbFuwzEom0/i4osfYEUSAhMYJX59bWYEcYQE9jFJXLm7h g2u/eLUBkaQFhYBF4kdRxeB2YwCBRJzNnyEslMkZnW9AbPZBDQk+k8cZgaxRQRCJW7OPQ82iF ngF6PEya6zQEUcHMICURKr79pBzFSVOHXpB1g9L9D8S2ufM0GcJydx8thkVhCbU8BVomXeERa I31wkXsy+zjiBUXgBI8MqRo3i1KKy1CJdIyO9pKLM9IyS3MTMHF1DA2O93NTi4sT01JzEpGK9 5PzcTYzAEK1nYGDcwTj1hN8hRkkOJiVR3ptMhyOF+JLyUyozEosz4otKc1KLDzHKcHAoSfBO4 wDKCRalpqdWpGXmAKMFJi3BwaMkwpsFkuYtLkjMLc5Mh0idYtTl6Lh59w+TEEtefl6qlDjvA5 AiAZCijNI8uBGwyL3EKCslzMvIwMAgxFOQWpSbWYIq/4pRnINRSZj3BcgUnsy8ErhNr4COYAI 6InvDAZAjShIRUlINjMY/+frPfLT1D5p2b+m8Gee+p3kbZ/+de1ZaSv6v1NI7k1U2rGkQd3ub tz/uuuDxo3NuvrmV8t/g4rSzT75/ELgmIPxvc8NvK9HEInv5E0GWD2NsFK2ijL2qMoLtJ4Q3B 83/2mW1qXTXds1zxorqdtsuhOeu8j53/n7CnIhUfZcb6bfT7HNTDiuxFGckGmoxFxUnAgDjBa md1wIAAA== X-Env-Sender: sgoel@codeaurora.org X-Msg-Ref: server-8.tower-31.messagelabs.com!1505954243!115857500!1 X-Originating-IP: [198.145.29.96] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 45277 invoked from network); 21 Sep 2017 00:37:24 -0000 Received: from smtp.codeaurora.org (HELO smtp.codeaurora.org) (198.145.29.96) by server-8.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 21 Sep 2017 00:37:24 -0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 73D726073B; Thu, 21 Sep 2017 00:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1505954242; bh=bBBiMjZXnbJe+oy75Mhmag4n4G5uzGHc3XWEeJ0t6h8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DaBdW7V2pFjmuphRvwb+tzvm3/VuaJefCpg1P0ctHVpZPjHzAHUfCnw7LP/cA0NEo 3YKJ0vQ9lrAYga28vP+HoDD4mmevj8SN0SkabdMgTftprLJtTikvyvUFlln5UBBoU3 CqvglahFH9nbEJ9ljCs9r0PBzZPaEvgCLN+mGlfg= Received: from sgoel1-lnx.qualcomm.com (unknown [129.46.14.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sgoel@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0CE4560738; Thu, 21 Sep 2017 00:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1505954241; bh=bBBiMjZXnbJe+oy75Mhmag4n4G5uzGHc3XWEeJ0t6h8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ba4AfP1kovnYN80OglyTkY5WIXmN58HrwTORAxVLLQog6tbMghM9QEcirF8f9CU/s QSylG0ssbCI1qZKauqlhEr+oaUIkLIMOCM0X8mavL1XjottVkEOxI9VpTRZkvZ7AX5 xeAD9oERg82dB0A7l30qQcCfyXHfzRe1J/B4HwSM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0CE4560738 From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Wed, 20 Sep 2017 18:37:04 -0600 Message-Id: <1505954230-18892-2-git-send-email-sgoel@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1505954230-18892-1-git-send-email-sgoel@codeaurora.org> References: <1505954230-18892-1-git-send-email-sgoel@codeaurora.org> Cc: sstabellini@kernel.org, wei.liu2@citrix.com, george.dunlap@eu.citrix.com, Andrew.Cooper3@citrix.com, jbeulich@suse.com, Sameer Goel , Ian.Jackson@citrix.com, nd@arm.com, robin.murphy@arm.com, shankerd@codeaurora.org Subject: [Xen-devel] [RFC v2 1/7] passthrough/arm: Modify SMMU driver to use generic device definition X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Modify the SMMU code to use generic device instead of dt_device_node for functions that can be used for ACPI based systems too. Signed-off-by: Sameer Goel --- xen/drivers/passthrough/arm/smmu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c index 74c09b0..362d578 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -76,7 +76,7 @@ struct resource #define resource_size(res) (res)->size; -#define platform_device dt_device_node +#define platform_device device #define IORESOURCE_MEM 0 #define IORESOURCE_IRQ 1 @@ -97,12 +97,12 @@ static struct resource *platform_get_resource(struct platform_device *pdev, switch (type) { case IORESOURCE_MEM: - ret = dt_device_get_address(pdev, num, &res.addr, &res.size); + ret = dt_device_get_address(dev_to_dt(pdev), num, &res.addr, &res.size); return ((ret) ? NULL : &res); case IORESOURCE_IRQ: - ret = platform_get_irq(pdev, num); + ret = platform_get_irq(dev_to_dt(pdev), num); if (ret < 0) return NULL; @@ -2285,7 +2285,7 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) const struct of_device_id *of_id; struct resource *res; struct arm_smmu_device *smmu; - struct device *dev = &pdev->dev; + struct device *dev = pdev; struct rb_node *node; struct of_phandle_args masterspec; int num_irqs, i, err; @@ -2338,7 +2338,7 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev) } for (i = 0; i < num_irqs; ++i) { - int irq = platform_get_irq(pdev, i); + int irq = platform_get_irq(dev_to_dt(pdev), i); if (irq < 0) { dev_err(dev, "failed to get irq index %d\n", i); @@ -2819,7 +2819,7 @@ static __init int arm_smmu_dt_init(struct dt_device_node *dev, */ dt_device_set_used_by(dev, DOMID_XEN); - rc = arm_smmu_device_dt_probe(dev); + rc = arm_smmu_device_dt_probe(dt_to_dev(dev)); if (rc) return rc;