From patchwork Tue Dec 19 03:16:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Goel X-Patchwork-Id: 122335 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3622090qgn; Mon, 18 Dec 2017 19:19:52 -0800 (PST) X-Google-Smtp-Source: ACJfBovyfpQZ7gOvZ9TwOy/ILMfVe+oXTiuS0sp4CgSyskqx9skAegBIFXT/bAd1TDpuvfSm4+XZ X-Received: by 10.36.79.75 with SMTP id c72mr1490046itb.146.1513653592579; Mon, 18 Dec 2017 19:19:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513653592; cv=none; d=google.com; s=arc-20160816; b=r/un5p7AjLCoJxnYUlx39ys1wqDLprq4W2a9O5zxYTkrcEBgbXn+khKtbJ8f3/JmJ6 e1N6nPjGJ4vlaGQ1kekRwEaj2sTJJyw3IxOuPjpSuV4BYN1c+2jujflqJoGHQMZjjcCo zr0D8D83hOdLdVuBD+IF0frYgMWJbGaul8JaBeSnyFjAHMB3nccQhJ5SAiWINEfApH2f RE0nDZLkm4oMrl1xU23E1JT1r1FMY421doJuKP6wMXKamyMWdL3W8lSbg677yCAZB35G EnrjuXNSDb6mud48DVeOJ6Ma3i7NCWE4UEJgmRtzMQ/ZhIBTAQVWRmRQqw2dE/aLNGeG VQrA== 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=QpHCZnAcupwrecXrr8xXKVGKIcZdgrhBUCgWLV01Rok=; b=pxjU0FaVF+OgbQnc66U0UHys4wiDGf5q/Uw2UUoSZ4Vv5w4V14jjxEoCoXcXKniMf7 ZQH5JMpqD6glW4X+gtda5WyFz55Df8/pIhOh/Z8sgpUl8++dLbRgdJcT4vSNf0noJ28l Xj9pRG+HioWDio5g9iWWeQ25dfb/AXepJeb0zgEQ+OWsML3xh06XDW+CZk/79U51SOd+ uaYWr1KXamaBo40n7yiPHvZiISHm+/vASAVyN8Ktw6WdPuWNV3b2JheiHf3IyRlqTQQD jYOct/vE5liSTYRm5WqDB6U6JzqNPjvP85UGv0v1/+4iEMGx0dYtpFMGgmveTI3gbgj3 vbPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=LfnysBn4; 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 m124si611633ita.20.2017.12.18.19.19.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 19:19:52 -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=LfnysBn4; 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 1eR8PA-0006bh-F1; Tue, 19 Dec 2017 03:17:20 +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 1eR8P9-0006bY-Ha for xen-devel@lists.xenproject.org; Tue, 19 Dec 2017 03:17:19 +0000 X-Inumbo-ID: 0525221a-e46b-11e7-b4a6-bc764e045a96 Received: from mail-pl0-x241.google.com (unknown [2607:f8b0:400e:c01::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 0525221a-e46b-11e7-b4a6-bc764e045a96; Tue, 19 Dec 2017 04:16:36 +0100 (CET) Received: by mail-pl0-x241.google.com with SMTP id d21so6140070pll.1 for ; Mon, 18 Dec 2017 19:17:18 -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=qwxoppV17Nh/swhXkHau79+Tb+Y1DS+RoQuywVBSrqc=; b=LfnysBn4QX02nq5rYap+7HISYK0qb8jguQEy5la5QCwSjVq+QBjCPJuSulEoSdpEqt 4LO0WJ/TzQGrS/PPyX/vUrvNGrvo4ajN7FaXGEsMCUAuVYKtYtFNkHlftAcy7xdwy9VP KseagNPrs2XV+hzTkJqWWwGAXBjHcxp/PIKS0= 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=qwxoppV17Nh/swhXkHau79+Tb+Y1DS+RoQuywVBSrqc=; b=F79Lk1h1mZ2gBVC1uaYrtA991hsTcu4cNvKygdzxkVl8+SmTfEXXhlKoaV/2E8psB+ zxPZJ+3VHJFnJ9kzIEobN+RUcLK4MjlcN/6vuDj09Y30cwxNqICwTPYRMTsK73ROA/2Z WXCS24ts2Xukbwg0AlKcna+EZODf+4rfdigXLdq+G/MXXm1vezXBKsIwmcfo+a5AhwJo zeSpZFogtDS5kyM+gbVfaP1EW7lRMK4CndCNSA8CdqJMDi2KC1zYhyuSkSYI4DKsriXR XxyZoMXcp2D8fYHbZOCnaYAAeSpyYtVocrZz5HLjnNPs+5emGFSK20fXWyNzn4FQLJFi dznQ== X-Gm-Message-State: AKGB3mKIW9EhlbO5uWqEaZXssO76zLLpGZ7N3yjHXWciBdi/7VpZSbj8 pM/hyLg9q48S/yKCYjagiCbxNxB7xOYT2Q== X-Received: by 10.159.204.146 with SMTP id t18mr1857553plo.236.1513653437543; Mon, 18 Dec 2017 19:17:17 -0800 (PST) Received: from sameer-ubuntu-book.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 84sm28289917pfp.180.2017.12.18.19.17.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 19:17:17 -0800 (PST) From: Sameer Goel To: xen-devel@lists.xenproject.org, julien.grall@arm.com, mjaggi@caviumnetworks.com Date: Mon, 18 Dec 2017 20:16:59 -0700 Message-Id: <20171219031703.23420-5-sameer.goel@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171219031703.23420-1-sameer.goel@linaro.org> References: <20171219031703.23420-1-sameer.goel@linaro.org> MIME-Version: 1.0 Cc: sstabellini@kernel.org, shankerd@codeaurora.org, andre.przywara@linaro.org, Sameer Goel Subject: [Xen-devel] [RFC v4 4/8] 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;