Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp472990imm; Fri, 21 Sep 2018 03:25:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYcjFGKwdPBlxCJVoPqL8+hAmvZdIXb2bFzdMCr4ljQ/zRKIhll9NFRcxWvoSRiMB2/KCF7 X-Received: by 2002:a62:848e:: with SMTP id k136-v6mr45753912pfd.231.1537525532594; Fri, 21 Sep 2018 03:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537525532; cv=none; d=google.com; s=arc-20160816; b=LNstuz8ewG/y4p974wzsjMWFjYiFz1outaiiHEGEWvgk7Q1szy87f0ooUwubIDqPry rNT/netPURc0N/VO21TN4UQw7//LRj+DPdw65nH3vpX0jCc9hsxO4exG1+b2aWaR9FEg lf6FvoOEgxDVo2vC1gd4cFe7hiLu80B2met4wmv2gLDCe0RYunKn6oQgoItqEVgsmEmt 05G6+tga5d8HqRbaSuLtYMhRYwNtBNwa7HwwfY1jnI8tKCf1yK2aSSmbv1sAmoI2S9Wk RzTHMhDin1DiEyR8cXZbbZAuRMVUOqXkK3Ym8Q5iz+WVOzfEfpBiUrFW7kE5JYznG5uo ge1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=eN2QjYF7XPN5wdQWDOgORmztfTZi1+IN0RnaI/q47uM=; b=dBsKjuOr4Nxv7R/xUA+U1+QpUn3a/HYmf/tjK4nOrS0XemHxjo/7k3PtBGDIdlgJWp nDx9W+VsLTNhEpI+usED6JqrVicAE/mjejMBLfYvOXmAQgmfGQEjZFxlmgn/Nvo9H8P+ pYsGnrfF4tqI81KBCdrUCnVh9RyybFoEJAu14wb4wtX0k+j602RtfjNcOW7mlkZW5M7d hpL09M1ZzF4k37mxZ8RDdNK5ojBYiU7T7ya9wAEdym3aZe+ci3J//+pFG2DfBDWZTDkd pvegSK2CHbSjRcBt1d9f/XFi5N6xDWJ3CR70c7RzFFBYpp2vfDITXomI71T44TlkWcSC 1vCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mUYoOwvO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 43-v6si4988318plb.444.2018.09.21.03.25.16; Fri, 21 Sep 2018 03:25:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mUYoOwvO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390096AbeIUQMu (ORCPT + 99 others); Fri, 21 Sep 2018 12:12:50 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:35152 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727776AbeIUQMt (ORCPT ); Fri, 21 Sep 2018 12:12:49 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w8LAOCEU030588; Fri, 21 Sep 2018 05:24:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1537525452; bh=eN2QjYF7XPN5wdQWDOgORmztfTZi1+IN0RnaI/q47uM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=mUYoOwvOuF4LdCFoLhYliXtHs9zuYOSfzR388fCluI4435BPzRQms35ZdS4cjG+/b 87Dlt47vHmJvxbyQdB5ByAWBdHRbWwAQ3aIeWnc6m/rLID4rrbTFEctCDN5a5K8QMC ST2WiPaQ9LMlAmjn9JMYShQGvhYFS1+F5oH4oTsg= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8LAOCdB019982; Fri, 21 Sep 2018 05:24:12 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 21 Sep 2018 05:24:12 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 21 Sep 2018 05:24:12 -0500 Received: from a0393678ub.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w8LAMEtS032280; Fri, 21 Sep 2018 05:24:07 -0500 From: Kishon Vijay Abraham I To: Jingoo Han , Joao Pinto , Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Murali Karicheri , Kishon Vijay Abraham I , CC: Mark Rutland , Santosh Shilimkar , Tero Kristo , Nishanth Menon , , , , Subject: [RFC PATCH 24/40] PCI: keystone: Move initializations to appropriate places Date: Fri, 21 Sep 2018 15:51:39 +0530 Message-ID: <20180921102155.22839-25-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921102155.22839-1-kishon@ti.com> References: <20180921102155.22839-1-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No functional change. Move host specific platform_get_resource to ks_add_pcie_port and the common platform_get_resource (applicable to both host and endpoint) to probe. This is in preparation for adding endpoint support to pci-keystone driver. Signed-off-by: Kishon Vijay Abraham I --- drivers/pci/controller/dwc/pci-keystone.c | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c index 75d007148804..13e865f82f96 100644 --- a/drivers/pci/controller/dwc/pci-keystone.c +++ b/drivers/pci/controller/dwc/pci-keystone.c @@ -646,11 +646,6 @@ static int __init ks_pcie_add_pcie_port(struct keystone_pcie *ks_pcie, struct resource *res; int ret; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbics"); - pci->dbi_base = devm_pci_remap_cfg_resource(dev, res); - if (IS_ERR(pci->dbi_base)) - return PTR_ERR(pci->dbi_base); - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "config"); pp->va_cfg0_base = devm_pci_remap_cfg_resource(dev, res); if (IS_ERR(pp->va_cfg0_base)) @@ -658,13 +653,6 @@ static int __init ks_pcie_add_pcie_port(struct keystone_pcie *ks_pcie, pp->va_cfg1_base = pp->va_cfg0_base; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "app"); - ks_pcie->va_app_base = devm_ioremap_resource(dev, res); - if (IS_ERR(ks_pcie->va_app_base)) - return PTR_ERR(ks_pcie->va_app_base); - - ks_pcie->app = *res; - pp->ops = &ks_pcie_host_ops; ret = dw_pcie_host_init(pp); if (ret) { @@ -768,6 +756,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev) struct dw_pcie *pci; struct keystone_pcie *ks_pcie; struct device_link **link; + struct resource *res; + void __iomem *base; u32 num_viewport; struct phy **phy; u32 num_lanes; @@ -784,6 +774,19 @@ static int __init ks_pcie_probe(struct platform_device *pdev) if (!pci) return -ENOMEM; + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "app"); + ks_pcie->va_app_base = devm_ioremap_resource(dev, res); + if (IS_ERR(ks_pcie->va_app_base)) + return PTR_ERR(ks_pcie->va_app_base); + + ks_pcie->app = *res; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dbics"); + base = devm_pci_remap_cfg_resource(dev, res); + if (IS_ERR(base)) + return PTR_ERR(base); + + pci->dbi_base = base; pci->dev = dev; pci->ops = &ks_pcie_dw_pcie_ops; -- 2.17.1