From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745AbdJaIOq (ORCPT ); Tue, 31 Oct 2017 04:14:46 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:48700 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbdJaIOn (ORCPT ); Tue, 31 Oct 2017 04:14:43 -0400 Subject: Re: [PATCH v2 08/17] PCI: dwc: dra7xx: Assign pp->ops in dra7xx_add_pcie_port() rather than in probe To: Niklas Cassel , Bjorn Helgaas References: <20171030124221.20690-1-niklas.cassel@axis.com> <20171030124221.20690-9-niklas.cassel@axis.com> CC: Niklas Cassel , , , From: Kishon Vijay Abraham I Message-ID: Date: Tue, 31 Oct 2017 13:44:01 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20171030124221.20690-9-niklas.cassel@axis.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 30 October 2017 06:12 PM, Niklas Cassel wrote: > This matches how other drivers like exynos, imx7, keystone, armada8k, > artpec6, designware-plat, hisi, kirin and spear13xx does it. > > This is probably a remainder since when dev and ops were assigned as > members to pp. Since we now assign them as members to struct dw_pcie, > the pp->ops assignment should definitely be in dra7xx_add_pcie_port(). > > This is also needed to be able to compile host/ep mode specific code > independently. > > Signed-off-by: Niklas Cassel Acked-by: Kishon Vijay Abraham I > --- > V2: > * New patch in this series. > > drivers/pci/dwc/pci-dra7xx.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c > index a743545da4d4..009f6aeeee1c 100644 > --- a/drivers/pci/dwc/pci-dra7xx.c > +++ b/drivers/pci/dwc/pci-dra7xx.c > @@ -460,6 +460,8 @@ static int __init dra7xx_add_pcie_port(struct dra7xx_pcie *dra7xx, > if (!pci->dbi_base) > return -ENOMEM; > > + pp->ops = &dra7xx_pcie_host_ops; > + > ret = dw_pcie_host_init(pp); > if (ret) { > dev_err(dev, "failed to initialize host\n"); > @@ -588,7 +590,6 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) > void __iomem *base; > struct resource *res; > struct dw_pcie *pci; > - struct pcie_port *pp; > struct dra7xx_pcie *dra7xx; > struct device *dev = &pdev->dev; > struct device_node *np = dev->of_node; > @@ -616,9 +617,6 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev) > pci->dev = dev; > pci->ops = &dw_pcie_ops; > > - pp = &pci->pp; > - pp->ops = &dra7xx_pcie_host_ops; > - > irq = platform_get_irq(pdev, 0); > if (irq < 0) { > dev_err(dev, "missing IRQ resource: %d\n", irq); >