Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1832250ybv; Fri, 21 Feb 2020 04:16:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwlzlszyiN/gHf5PetrdOf9pbx91lQrQfShP+tfkL8SPDgvMSNZPBX062tPWOToctHrc3Oh X-Received: by 2002:a05:6830:4c7:: with SMTP id s7mr27532871otd.359.1582287365342; Fri, 21 Feb 2020 04:16:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582287365; cv=none; d=google.com; s=arc-20160816; b=OP4paPZk63U3wM2PpKoAwE2FtA0NM3smt/xtv9kzJiqUAUV65iCM6J0UKEKjdCpUHp L/XP2YfDyNP/zpACkZYkzl0lrwLaim67EeHsw2R56sfgN/uQwc4TvKgiDosephHBGHla k3Z18l7+jkEQ9sEvD3Q78eDTuZZmHp1gEXBUo6Pbu7xxR7FHyBeiqZbZECwvxLKjlmVW H5w98jO1jO5XWe85ictrZg9sz1wrdJo+nUBebDBiCdjQ0YPC9mKLL6p9w1tTC2K1OA8t f+pHIvcofnuOyV2v5lMSiVzmn3MiJ2Qkd/WZuZRKAzX5THeIbqJ93IIu12ddBW7qkOs6 xaUA== 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=U4Z9OGCEAvVm1GtwlKMpAg1rnGIf/a4Rr5l8QdWqLew=; b=RYZsGTET3GWhugU9glzMVxdyrL4RjIYn5sD4aa5pkCpM9dwtRS6LWwOI++Be8LIetx 6l6x4L740yn6EQntyRI0YidjoAeKkavbW5PY5aOz4YboZEvGF1/mv0pSD7CnqnL9eAle hfk2ntoT2xBZ4h1l8e9jq9dQndu2EQzGYSp0ClavnaqnxDkw4KFfUlbOavTq+ZS9/nKe vQQrlVL3MvV9BmtX3VAmiC0fJ4ME+6PNRf/hFmU2wx6BP6zHUPr9B2i2ZPCjAO79qOwA KghRgNcUsfs2dr4cH14TSsSNmuqehVuTduNbKHA+GS/CcVTW3HdvmmZb9MRglCrzTjZt mZeg== 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 u25si575316oic.160.2020.02.21.04.15.52; Fri, 21 Feb 2020 04:16:05 -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 S1727095AbgBUMPK (ORCPT + 99 others); Fri, 21 Feb 2020 07:15:10 -0500 Received: from foss.arm.com ([217.140.110.172]:38024 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726909AbgBUMPJ (ORCPT ); Fri, 21 Feb 2020 07:15:09 -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 1DF9630E; Fri, 21 Feb 2020 04:15:09 -0800 (PST) Received: from e121166-lin.cambridge.arm.com (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C3EB43F68F; Fri, 21 Feb 2020 04:15:06 -0800 (PST) Date: Fri, 21 Feb 2020 12:15:01 +0000 From: Lorenzo Pieralisi To: Zhiqiang 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, andrew.murray@arm.com, arnd@arndb.de, mark.rutland@arm.com, l.subrahmanya@mobiveil.co.in, shawnguo@kernel.org, m.karthikeyan@mobiveil.co.in, leoyang.li@nxp.com, catalin.marinas@arm.com, will.deacon@arm.com, Mingkai.Hu@nxp.com, Minghuan.Lian@nxp.com, Xiaowei.Bao@nxp.com Subject: Re: [PATCHv10 02/13] PCI: mobiveil: Move the host initialization into a function Message-ID: <20200221121501.GA12711@e121166-lin.cambridge.arm.com> References: <20200213040644.45858-1-Zhiqiang.Hou@nxp.com> <20200213040644.45858-3-Zhiqiang.Hou@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200213040644.45858-3-Zhiqiang.Hou@nxp.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 13, 2020 at 12:06:33PM +0800, Zhiqiang Hou wrote: > From: Hou Zhiqiang > > Move the host initialization related operations into a new > routine such that it can be reused by other incoming platform's > PCIe host driver, in which the Mobiveil GPEX is integrated. > > Change the subject and change log slightly. > Change the function mobiveil_pcie_host_probe to static. > Add back the comments that was lost in v9. I removed the paragraph above since it is a leftover and does not belong in the commit log. Lorenzo > Signed-off-by: Hou Zhiqiang > --- > V10: > - Refined the subject and change log. > - Changed the mobiveil_pcie_host_probe() to a static function. > - Added back the lost comments. > > drivers/pci/controller/pcie-mobiveil.c | 39 +++++++++++++++----------- > 1 file changed, 23 insertions(+), 16 deletions(-) > > diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c > index d4de560cd711..01df04ea5b48 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) > +static int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie) > { > - struct mobiveil_pcie *pcie; > + struct mobiveil_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 mobiveil_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,25 @@ 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; > + > + /* allocate the PCIe port */ > + bridge = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); > + 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 >