From patchwork Fri Feb 9 03:10:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 127751 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp209280ljc; Thu, 8 Feb 2018 19:13:31 -0800 (PST) X-Google-Smtp-Source: AH8x227jlDqzpjdKzepM2bq2N2apsftrj0jn9JFzWrCFGxbrwbn7oCWgpdpruUSmcH0D3tt4ZcN5 X-Received: by 10.107.178.195 with SMTP id b186mr1598994iof.9.1518146011742; Thu, 08 Feb 2018 19:13:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518146011; cv=none; d=google.com; s=arc-20160816; b=dKErnLYP/a5JlnTADhqzuLqkpVX2UibPQaFQ60PsnOL10n7JG3S0zGdtK94bBOtaWQ wtepMDGjOQzEGGPJENwHjtfw5lGAb0qzL3EIGErGbqrzTBAQCXHjX6AjNKRBHx9sDUJn JrK3tGdXXFXfWwo+5jF3FYeE6pyU8E+g4H0xT5UBM8PsPldEmie1Pbm7cWSxYggjwbBo l36lhGq0d75yYGDUlUGTFFC/Ptpj2nbAQlcnK6QQZ+Ao4umIK1xIF9JrQ0jNIa0Vpotu oBHYUx6QkKy9Y4M+ZoVq6yQF2VcZAumJO2L9jdVlyPt2+bVVTEv7xUyIrbAq/1t7Ob6N h/EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-unsubscribe:list-id:precedence:subject:cc :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=daUF/b8sbq2dHg4K6PwJwJPAcqSqz+KZ+9xf0udpKY0=; b=loPdHuS54TIbXvkF0AvwQ/o9X2QUmCkctvEiAo5QsdrSJcJnB5ByyI/ADNsQ2uu9pZ ZKCLp0qiES8w+YWu6KbbAHV0hVibs2c22IQF47wLGvZW0YEfJ4Sl+GRyYEpS3r9kV8CH B0KQ+3XkQcIY6ukehtL+k/rM8hAZphX/xQBazx9hTm7fkDOYcDNUQjTG1FWY5OxYr5q+ Q4j2UhzTascFx9KV3/B7DL2UXbNqGjVH1Ba11ngxZ2/gIq3jtfffc3R5aU8Hn6T4C0Dq lzMU7ewQWfIsk85Ex4wK4tret8F6M/Ye885oHtK/yRUk61HmOeM4zOgaVl/sW/o2qy81 JkbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d0ir+qod; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id u187si944995ioe.159.2018.02.08.19.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 19:13:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=d0ir+qod; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejz5v-000512-7e; Fri, 09 Feb 2018 03:11:23 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ejz5u-00050a-7Q for xen-devel@lists.xenproject.org; Fri, 09 Feb 2018 03:11:22 +0000 X-Inumbo-ID: d6b06139-0d46-11e8-ba59-bc764e045a96 Received: from mail-pg0-x243.google.com (unknown [2607:f8b0:400e:c05::243]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id d6b06139-0d46-11e8-ba59-bc764e045a96; Fri, 09 Feb 2018 04:10:53 +0100 (CET) Received: by mail-pg0-x243.google.com with SMTP id w17so2741322pgv.6 for ; Thu, 08 Feb 2018 19:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/xVfo4ZSAWN9fwPj8xrp9oET7pP4sFhfKt67zmGl2Qc=; b=d0ir+qodRs9yBUigg+7SB3EivQW+jsFgpqaxYKO0SVCjkjOF7ZUerCqkTCGR0zEviI F9b59ZeN387emxKS1ICadqIWk3qZGaOfOiYRgR6dMfAdHXl8fyVn949Nu+B2vaSnVxty sQTnUfwVcIxzdbzv3a6fE9R5R1ITP8srxH9qI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/xVfo4ZSAWN9fwPj8xrp9oET7pP4sFhfKt67zmGl2Qc=; b=g/EcRt7e6roD0C7NHbuo+TkUR8RDuEDcvklZcAftkfzdeONbtHpRNxiEaeCuu7Oafk XV85mx7VjJrSUo8+IbUnId1nj2MWQ5YtUEAfrgZNLLn4EfunRZuOzAFA7FIjgnLfrNjW L+g1/yfvDQLzVNbYyhfY7Phxzfnl7Ih94HAV5UaNWp9tVytyRbPHJHAVt7eO9jGTZStZ thTSqDV/8WREEgEqj2sU6LdYD8co2YACSxJx8c+gncNPEOA5zsBkd6h4vkNIygxHGSS6 JrgtpqQVTU3IvFNjSOGfKqUjRBQ1k767EPjacK8pYFDjuzXEXK8Bwvq3ZozyN3Osm6U1 +NKA== X-Gm-Message-State: APf1xPBJqSjSSFHmsG1alL5qQIEacaTyo9QheLT6RMZ/cNTYBfWa30mu g4ue5ivvH7CEgJQDf86Uon1ZGQrdiFhHmg== X-Received: by 10.99.117.28 with SMTP id q28mr1109004pgc.388.1518145880595; Thu, 08 Feb 2018 19:11:20 -0800 (PST) Received: from localhost.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id z15sm2663487pgr.62.2018.02.08.19.11.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 19:11:20 -0800 (PST) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Thu, 8 Feb 2018 20:10:51 -0700 Message-Id: <20180209031055.21926-4-sameer.goel@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180209031055.21926-1-sameer.goel@linaro.org> References: <20180209031055.21926-1-sameer.goel@linaro.org> MIME-Version: 1.0 Cc: sstabellini@kernel.org, shankerd@codeaurora.org, Sameer Goel Subject: [Xen-devel] [PATCH 3/7] passthrough/arm: Modify SMMU driver to use generic device definition X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 Acked-by: Julien Grall --- 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 45acb89380..ad956d5b8d 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; @@ -2286,7 +2286,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; @@ -2339,7 +2339,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); @@ -2820,7 +2820,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;