Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp62275ybe; Sun, 1 Sep 2019 20:30:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYyIUjRZqT4yVvJC7wuokVr2D0vzFKuG05v6mb6tuFefkIPlKswUWAnzhJucfzRB7G6DHl X-Received: by 2002:a63:a302:: with SMTP id s2mr23540337pge.125.1567395006689; Sun, 01 Sep 2019 20:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567395006; cv=none; d=google.com; s=arc-20160816; b=hevZT803VocCVzmtjtrUmN/RVaZiOGdYTdrQy2E2HHPaAM6xjnWaKslwox9KGwPtJE pEYM5GGGa5LZO9GyAwA2CKJSlBPZu77t/GwJdTrXLnXWhijfBe8BYT/bbaXNYD1uDpru 6tUxMRbtKnWDJaq4dwmeH3gGfktry3rWeOEDbSEDF/LNFeMcvGAlOcfuTGcXqt+UOzrd ysjrzg913VHIR0LO5onJ/pyWlmAPcxRoXVwJRlag1SoO75vTIikiE7dx+notWsgRpFSc OO26CNQA96Yv5MavD6rs7NvKFXrc3RYoGw1nUDjL+aWimUlB/Udm/Nu0iPanS4pEandW LjAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=gnpSSCpKi5BBL6JA++0oTAoVBlugx+f7Z/eO5viuLlI=; b=JfTFIJQwsKqF6s57sdrPxtTGgxwG2ykya6dCULdU6ANdaT/jXH4x2RFWEybcgxqWu9 UWUw4EEaa5ejeXY96I+zpBBP3UpwFrJ9+vUT1vOF4QO+2WnC1600/wBQZq6TvVHlGujK jBAXH0mA+ivhwmVz41p9LBdCWlnW5eyBHRpa1TjjWKoJIAIlXKXoyTn7f/+4VDByu5Y7 j+RUXmHIjWwT/6PPmTHL+3iA7fdg7+DQN/YY4JPfoOVijpWQP+q+nmouTAW71ZDq/1hJ CkBBdGgQv+KodBgA1SSI4qqLTPfpYJKclX+HSYfconsh/1Y4+JW/AoKyC1ZdrMRqdwvv UJmw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si10206431pgm.122.2019.09.01.20.29.51; Sun, 01 Sep 2019 20:30:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729459AbfIBD20 (ORCPT + 99 others); Sun, 1 Sep 2019 23:28:26 -0400 Received: from inva020.nxp.com ([92.121.34.13]:32830 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729305AbfIBD1n (ORCPT ); Sun, 1 Sep 2019 23:27:43 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 04C6C1A0651; Mon, 2 Sep 2019 05:27:41 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7AD681A0650; Mon, 2 Sep 2019 05:27:32 +0200 (CEST) Received: from titan.ap.freescale.net (TITAN.ap.freescale.net [10.192.208.233]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 498C1402BE; Mon, 2 Sep 2019 11:27:22 +0800 (SGT) From: Xiaowei Bao To: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, leoyang.li@nxp.com, kishon@ti.com, lorenzo.pieralisi@arm.com, minghuan.Lian@nxp.com, mingkai.hu@nxp.com, roy.zang@nxp.com, jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org Cc: arnd@arndb.de, gregkh@linuxfoundation.org, zhiqiang.hou@nxp.com, Xiaowei Bao Subject: [PATCH v3 03/11] PCI: designware-ep: Move the function of getting MSI capability forward Date: Mon, 2 Sep 2019 11:17:08 +0800 Message-Id: <20190902031716.43195-4-xiaowei.bao@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190902031716.43195-1-xiaowei.bao@nxp.com> References: <20190902031716.43195-1-xiaowei.bao@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the function of getting MSI capability to the front of init function, because the init function of the EP platform driver will use the return value by the function of getting MSI capability. Signed-off-by: Xiaowei Bao Reviewed-by: Andrew Murray --- v2: - No change. v3: - No change. drivers/pci/controller/dwc/pcie-designware-ep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 55b23ce..c3bc7bd 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -624,6 +624,10 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) if (ret < 0) epc->max_functions = 1; + ep->msi_cap = dw_pcie_find_capability(pci, PCI_CAP_ID_MSI); + + ep->msix_cap = dw_pcie_find_capability(pci, PCI_CAP_ID_MSIX); + if (ep->ops->ep_init) ep->ops->ep_init(ep); @@ -640,9 +644,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) dev_err(dev, "Failed to reserve memory for MSI/MSI-X\n"); return -ENOMEM; } - ep->msi_cap = dw_pcie_find_capability(pci, PCI_CAP_ID_MSI); - - ep->msix_cap = dw_pcie_find_capability(pci, PCI_CAP_ID_MSIX); offset = dw_pcie_ep_find_ext_capability(pci, PCI_EXT_CAP_ID_REBAR); if (offset) { -- 2.9.5