From patchwork Thu Jun 7 23:47:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 137907 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp207293lji; Thu, 7 Jun 2018 16:50:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKhFwRltTvounDczhbvYUfifTEmYeYu8cD31R+X6AOUvoYlAYm9Gtt+Zo+Y3fKnajPR6fMq X-Received: by 2002:a24:202:: with SMTP id 2-v6mr3726784itu.63.1528415431037; Thu, 07 Jun 2018 16:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528415431; cv=none; d=google.com; s=arc-20160816; b=nU+z/n/kMIT4H4Ti0iPlRLUmuoD8+MBpBHkJk8PxBiMraLm4QBgIV1khckah0tDvvX gpRC9oH0NIFE0E+Vpk5QWNEt8Hw1gQ2tdDpj8fkdLB9OTrl3doocUuOT/F9AYY/0w73J Sq3o67tZq2kdACaoy/r7jZvMrfRru6PPCFdMWk6N6G7gM76I5lXH91maJ2eqEOmDRBXY ++oYlQ991sW2GNZFNI5SWdxOJoSUsXbq0kPoxAGYRYSEaFfxAzfTV/FoPmyXuww1CrDg oQIlRqsp4ugs7cu2LWjvOfOsTKFItGqzdFSWmxnBjAWBwkZ5bDReGhrpA9wcLQh36385 a7jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=DWTJotIW//11xatH33jM+wcnksLVI6nLVd8vmAWmC4U=; b=xyM0E6eMBDDIYZTHf8iiuEy3G1Pz7IeZlwmSxZF89OoEWqOV4KrMdWT8zqrw7EbEQQ IrH6oB2WqjODKPT2Escj0Eqb1ByqvrTVzmA2OmK0PA9Y2s5V4qKaTZqR6PuGcEP9vt0N eO4ITbtEwiyupVfn3ponzCG1HMB286TRntELnSAjM+qs8V1v5jyidSQtYKpiRUsm5owg 5QwSKYicmb/7Lc3lRi2g3eZtbUvXd587LZ2goNm/MBRFLhU6ovjMdLfLyuNPfZ44QbQ7 jmhY7jLBua/IP/cGYaYiAJkWQYl0+catXDbsLnJJlV7ht1ZzFf5Ux7lo5WsBPGyITbRw IwTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hzd8O87Z; 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 f16-v6si108371itb.61.2018.06.07.16.50.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Jun 2018 16:50:31 -0700 (PDT) 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=hzd8O87Z; 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.89) (envelope-from ) id 1fR4dF-0007gk-6I; Thu, 07 Jun 2018 23:47:53 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fR4dD-0007gd-Er for xen-devel@lists.xenproject.org; Thu, 07 Jun 2018 23:47:51 +0000 X-Inumbo-ID: dd9b8e2c-6aac-11e8-9728-bc764e045a96 Received: from mail-pl0-x242.google.com (unknown [2607:f8b0:400e:c01::242]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id dd9b8e2c-6aac-11e8-9728-bc764e045a96; Fri, 08 Jun 2018 01:45:32 +0200 (CEST) Received: by mail-pl0-x242.google.com with SMTP id a7-v6so4621498plp.3 for ; Thu, 07 Jun 2018 16:47:50 -0700 (PDT) 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=fs+QXomoNRlF+XPOS5yEoJ4Ast7AZymuAOAz/11d2zE=; b=hzd8O87Zs73QetCvZ9Yrw061kq5DzA0b62CYnKYqrT0WANjpXpcEK418Jzi7AFa3su Y5sFkyyfh6xTiT6DqSFSeiGe3tsGIwPYfpVqsF+Scdrp1ENWQ6oGRgCWuNtetAvhn/h6 q+NYp1OZdFB173LUQdNk9VB0inRgXfz/989PI= 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=fs+QXomoNRlF+XPOS5yEoJ4Ast7AZymuAOAz/11d2zE=; b=jmA5tphcWFE97klqp3jwh/yT1Nqlqb4PGcS+izQFO3sN8s3xTv8Wz2y9fZAHpkpI/B /o50ZsCEXdwxQ6C8JA3I7/eS0kXsGPAE95ueWezdh5E6aUgpFrIs2fWz1OO7mhGLZOhF jg9fYRRYWwFh2yKLl+MKWYA+Ov0VhI8zDE6zVitzEFn/hzGDEJP3zHRci1kSOxU5UODr N9h2I5DBKt1Hf9FLIm6jx0iRo8gDmTQDzqSGXOQWNqCq2Qr0Ykl4LLT5QhTM316aSCkM 2WhasSllmSUE2/cBDMTlyK+LZWHnZCvO0R9Fo4fmmlHb4S/XfbI51Nr6BNFUQmTTf/BC CDlw== X-Gm-Message-State: APt69E1YA9HjbcCdVBi6qxEjN5oC+lq24u/PQcM18dn2MUKz0nuieMKx L0wCr3uwdQBnTDiSJeRLq/M2lIOPEdw= X-Received: by 2002:a17:902:7e07:: with SMTP id b7-v6mr3933408plm.230.1528415269677; Thu, 07 Jun 2018 16:47:49 -0700 (PDT) Received: from sameer-ubuntu-book.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id y20-v6sm46183321pge.46.2018.06.07.16.47.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 16:47:49 -0700 (PDT) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Thu, 7 Jun 2018 17:47:28 -0600 Message-Id: <20180607234732.20124-3-sameer.goel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180607234732.20124-1-sameer.goel@linaro.org> References: <20180607234732.20124-1-sameer.goel@linaro.org> MIME-Version: 1.0 Subject: [Xen-devel] [v3 2/6] passthrough/arm: Modify SMMU driver to use generic device definition X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: sstabellini@kernel.org, shankerd@codeaurora.org, Sameer Goel 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;