Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3772818ybl; Mon, 13 Jan 2020 02:20:23 -0800 (PST) X-Google-Smtp-Source: APXvYqyYRxFYcWY28YOdzXVI1yxNooP7OzfoXCW4IGo6kl1Kzz+APd5MvZrlpbDdwYYjLdGqS5kQ X-Received: by 2002:a9d:c02:: with SMTP id 2mr12768290otr.183.1578910823046; Mon, 13 Jan 2020 02:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578910823; cv=none; d=google.com; s=arc-20160816; b=VT/ZlLK4bbP4HEP3fhZu+C0oxU1om7+HCg07Ir1dwghdG54O38bMIB/KbeQkgBqFpe 9NTEOi0k+p22QKsKts8Xsom/9vSuRmR5Lgq/H0WGc73DvmMzYvrbBRBIaRjQA+FtIHvK iHcVnp0DsIRSEQBZRMiQS/rqUZplnJq/3BfBlSF9ATdunKK2ew96LmgPunijMZZPpPw/ WzHRQjy3LLdrqY+m6GQQMzwh+mT+IaEnoM+z3QB88DkJYqK3T/+BhtFYcblO1r6ncLRY zhzXDtki0FhZtzh9mm2B/utTp/RXNrn/qmKgyVx80e513LRLIABZE9uZUrXtI/q1Jkpg k1KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=NEhllfaFGiwcm7Z4D/t4ySiLjbV5MWjvzkR3ZAlZ0X0=; b=YMvsTFStmVEf8fkYbDPRQtFS00CcxxJggHYZBWuR+P2RQufY7m/cFJDt8JhqMuYBZ4 AoEPA7pvNSCf2GdewiZw0gCw6GuReOUb371T3MgvA5ECYZxvT7KXR18//hPc4iLrAH25 ks3yG5uqPKW5fCI6fAVc7kgDCwUjFd8dEYj3zWQataOXXyZUTQTA02cxX8cxg9GPP5lE hfEvCcIeN7jQ/G579Khi8BwZEIcCT8FnrHl433oiALKTd5sRKyNx+c5UgBTMNUq/GML5 /d858eJJMRanWTMpNTqUek28CIawMLI0LKZv+memONJ7g969/XzXhvOBJrMg7nw2Y112 RMHw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si6061568otn.117.2020.01.13.02.20.11; Mon, 13 Jan 2020 02:20:23 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726523AbgAMKTQ (ORCPT + 99 others); Mon, 13 Jan 2020 05:19:16 -0500 Received: from foss.arm.com ([217.140.110.172]:37098 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbgAMKTP (ORCPT ); Mon, 13 Jan 2020 05:19:15 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B0D1C13D5; Mon, 13 Jan 2020 02:19:14 -0800 (PST) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0189D3F534; Mon, 13 Jan 2020 02:19:14 -0800 (PST) Date: Mon, 13 Jan 2020 10:19:12 +0000 From: Andrew Murray To: "Z.q. Hou" Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhelgaas@google.com" , "robh+dt@kernel.org" , "arnd@arndb.de" , "mark.rutland@arm.com" , "l.subrahmanya@mobiveil.co.in" , "shawnguo@kernel.org" , "m.karthikeyan@mobiveil.co.in" , Leo Li , "lorenzo.pieralisi@arm.com" , "catalin.marinas@arm.com" , "will.deacon@arm.com" , Mingkai Hu , "M.h. Lian" , Xiaowei Bao Subject: Re: [PATCHv9 02/12] PCI: mobiveil: Move the host initialization into a routine Message-ID: <20200113101912.GH42593@e119886-lin.cambridge.arm.com> References: <20191120034451.30102-1-Zhiqiang.Hou@nxp.com> <20191120034451.30102-3-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191120034451.30102-3-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 20, 2019 at 03:45:30AM +0000, Z.q. Hou wrote: > From: Hou Zhiqiang > > Move the host initialization related operations into a new > routine to make it can be reused by other incoming platform's s/to make/such that/ 'function' is probably a better word than 'routine'. > PCIe host driver, in which the Mobiveil GPEX is integrated. > > Signed-off-by: Hou Zhiqiang > --- > V9: > - New patch splited from the #1 of V8 patches to make it easy to review. > > drivers/pci/controller/pcie-mobiveil.c | 38 +++++++++++++++----------- > 1 file changed, 22 insertions(+), 16 deletions(-) > > diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c > index 5fd26e376af2..97f682ca7c7a 100644 > --- a/drivers/pci/controller/pcie-mobiveil.c > +++ b/drivers/pci/controller/pcie-mobiveil.c > @@ -873,27 +873,15 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie) > return 0; > } > > -static int mobiveil_pcie_probe(struct platform_device *pdev) > +int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) This is no longer static - but do you need to add a header file somewhere? > { > - struct mobiveil_pcie *pcie; > + struct root_port *rp = &pcie->rp; > + struct pci_host_bridge *bridge = rp->bridge; > + struct device *dev = &pcie->pdev->dev; > struct pci_bus *bus; > struct pci_bus *child; > - struct pci_host_bridge *bridge; > - struct device *dev = &pdev->dev; > - struct root_port *rp; > int ret; > > - /* allocate the PCIe port */ > - bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); > - if (!bridge) > - return -ENOMEM; > - > - pcie = pci_host_bridge_priv(bridge); > - rp = &pcie->rp; > - rp->bridge = bridge; > - > - pcie->pdev = pdev; > - > ret = mobiveil_pcie_parse_dt(pcie); > if (ret) { > dev_err(dev, "Parsing DT failed, ret: %x\n", ret); > @@ -956,6 +944,24 @@ static int mobiveil_pcie_probe(struct platform_device *pdev) > return 0; > } > > +static int mobiveil_pcie_probe(struct platform_device *pdev) > +{ > + struct mobiveil_pcie *pcie; > + struct pci_host_bridge *bridge; > + struct device *dev = &pdev->dev; > + > + bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); You've lost the comment that was above this. Thanks, Andrew Murray > + if (!bridge) > + return -ENOMEM; > + > + pcie = pci_host_bridge_priv(bridge); > + pcie->rp.bridge = bridge; > + > + pcie->pdev = pdev; > + > + return mobiveil_pcie_host_probe(pcie); > +} > + > static const struct of_device_id mobiveil_pcie_of_match[] = { > {.compatible = "mbvl,gpex40-pcie",}, > {}, > -- > 2.17.1 >