From patchwork Thu May 24 00:46:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 136691 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1557339lji; Wed, 23 May 2018 17:48:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZooeVOXITrITaDiz1Z6vgNqPevfafsIYTq3N6rkogRvQ6eG+ucyo3VaX72ewAAe7POHBQJx X-Received: by 2002:a6b:3207:: with SMTP id y7-v6mr4605324ioy.191.1527122938933; Wed, 23 May 2018 17:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527122938; cv=none; d=google.com; s=arc-20160816; b=FSzoc0rWcNdXQew1dtV8v756YmUw3r85+al9/iqEdtprGvPbLzIueW8KbS7ZAeozJM d+umd4yfsxYOwheAmqUqP9RgYQ8LGWzqhyWkE4UeMZ8yhmmsmwg6/Cl+nhG+u5uO67dS iWTr0DruROARV/l64/ZfvHnwpDCS89PAavM3t1Zi4yGAhKDNeUG+K6io/lfmnXypvp4J RHvh9Sn7/qL6G8+Q1si97YrGOwTzhNYOccIlD9cafaGEEoQtM9YfwAKfAIKJU0Nm6+Zt N/dk5VwNBMFkRtiL4CehqqdgyQ+YeKpN3m1SR+zM74BFJo+b45Ne98fvbmnxF0CJAf2p w4gg== 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=Kr1PFOJA5QKtaFYPWhbpHiMga1Q0CTvq02yC+it5j28=; b=WxNmVr5pRVL3DzYDyGiTORA8A6+DRFIWJEdoLbic5cnuRo7T55QhN5SkVg5kecKAmh HrmgjsrxGAmC2T+XxPTSfSGn6Pz8DVs85ZsNzKVKD7239yQgFKj9L0+GEnBmqJGcU3v4 Eg5XiN+AxIQ5texg9QOpyQ/S0QkYgjy0nXvbArqQnXki3qlQEmzqLNygBrAUlXhLVhXf qeCFIMOkphuUh0d0056IVkqay/M69D1Goti/UpXqmuwe4m0sHkG14U2ou2XY+yt/ZqLP 9Yufet0ATITYfCPl/fmFCWFsznawHV5Yb4dOGp7fjqgh2frfwBgoMkdVSzFCUDbj4np5 5Y4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KaRRuh+n; 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 s83-v6si3185670itd.57.2018.05.23.17.48.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 17:48:58 -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=KaRRuh+n; 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 1fLeOv-0001D3-73; Thu, 24 May 2018 00:46:41 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1fLeOu-0001Cg-5j for xen-devel@lists.xenproject.org; Thu, 24 May 2018 00:46:40 +0000 X-Inumbo-ID: a64ebaec-5eeb-11e8-9728-bc764e045a96 Received: from mail-pl0-x244.google.com (unknown [2607:f8b0:400e:c01::244]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id a64ebaec-5eeb-11e8-9728-bc764e045a96; Thu, 24 May 2018 02:44:43 +0200 (CEST) Received: by mail-pl0-x244.google.com with SMTP id u6-v6so14026368pls.9 for ; Wed, 23 May 2018 17:46:38 -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=22/Q1sU+75ut0W3HXObrX9XCPZTvvsPsrT2Sl+m8wQE=; b=KaRRuh+n00Y2XvfIIILpby3GGDfV96yK+Xs08g5VPzVQ85vy8ni1DcYdsohGCpDAjH B9g3gysk5gp/nn+oWmvPsFbRSOOkNe/L2ng14kAvcU0cGvut4YKKY7E6WXiQVlprGdQG 0SdqpfVtUfAoWEj8Lf+w4OzxdvrwvJ/aSDfHY= 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=22/Q1sU+75ut0W3HXObrX9XCPZTvvsPsrT2Sl+m8wQE=; b=T8qToOCJDJU/6IvuZ3k1Cig/FvPzFzUXmakI55ci9J322qBfxv5oxGl6dA6GiTe5fe Fmcr/4Z/2ltRMZYT4v8u4O8ZkknW/ShRADuaMZLd2GOsKC6u+IRyPVxUuvF6sBo4uUrg YD7Zrs2SQBlqF9zpGarFOaYyeMPhzlh9IL1r6iuYiPXOCvXf4hU6J2yLBeFWIyvBCjzA vhIo6tCQ7l3FzBiUE4Wg08OOBBwl2UnoQjzxQFPWX9yPCkt/Tr59wjW1dBB94v0LJGcB fsgI9PtYBKMf0OewCQ2ZJQ1S+cm6te7Y9o0Sc/+XsC2fF8aqBJxFgoy4dHT5keMcTv37 nyGw== X-Gm-Message-State: ALKqPwcpFE/WvwpNyUcnU/B6zQEywwUaFd4QNg5KQVXED3hq3yRM/zG8 P7WLR8K69CoTgxEBY6nJSBsFob2flyo= X-Received: by 2002:a17:902:26a:: with SMTP id 97-v6mr5090729plc.367.1527122797840; Wed, 23 May 2018 17:46:37 -0700 (PDT) Received: from sameer-ubuntu-book.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id q15-v6sm18428438pgc.33.2018.05.23.17.46.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 17:46:37 -0700 (PDT) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Wed, 23 May 2018 18:46:16 -0600 Message-Id: <20180524004620.23828-3-sameer.goel@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524004620.23828-1-sameer.goel@linaro.org> References: <20180524004620.23828-1-sameer.goel@linaro.org> MIME-Version: 1.0 Subject: [Xen-devel] [v2 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;