Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1828330ybl; Thu, 15 Aug 2019 01:50:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqznBT7m4/+ynIaj8mVc/1KBhnpHrW06AmvhbT+CyYyssvAVEgi6P142hKxo8K1ECi+x1LQO X-Received: by 2002:a17:90a:8c92:: with SMTP id b18mr1225636pjo.97.1565859024310; Thu, 15 Aug 2019 01:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565859024; cv=none; d=google.com; s=arc-20160816; b=U6o0ZpJYn5rl3G6/AlIbgpoGw1WByQAl8Hs4X3jQZdGFIR+ct5ZsywailU9ZpgMvTQ 5K+y4I5UgB1rVTYzW4R1jwmnrDEfYEFPaTLUcSUbdDSmhcvFswz+ZJlUqWT8CTrHrnbR XdFbiR8Q0GWH2V6m1ULUTB0Fb7K8J2cUT6+cx4P5dOMFS15/P+uhGoCylQhJKhzDxmC4 OQaXVs+vsZd1L78utD8GLXR0Zay0QhjS3P/pKyEp1wiOY+xO7s/or7kGdP3Z+hlvAHZT klcfqq08vxaljhBNpzdAdBqrR8ZiUIL0vIRenFOe5C5IFLBcfKJax+ARtE01Oo/vgfZg S9uw== 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=ZCS4mNryCNSJMr+cvYqyP+8ZiBLJo0z39mmgcn+9Qsc=; b=tFhJGrAmNwbZpaFSgSJQFlA8Qc+nqPFzaVwxqTpdEvWyJO8ABhEnE3gl0BSq8y2n2Q B3we/1wx64Zyc5qIIwRQdPH3Qpo1C+yx8qjDkGRvsu/KIFnxR0lU6uvCwMO9GoLhIFq3 r66gDj6EEB71956SP6qU4CY/xb1V3wBFXAD2WdIMlFelv158WKVPmsio1NQvDwFp4xq1 rT8bUZFbHK3P5zMeDqAtzFKu/FVhM/ps1LwQGRsEvYh2GLa2WQo2VbHZcPP1TpSdlPlF vpH60hIxUwAOcXjxRQHIFaQTwigfhNlJGjQ5IzfT37MkLlMKu7w3fjAire6bRzbEtEdN kdRA== 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 i186si1472980pge.9.2019.08.15.01.50.08; Thu, 15 Aug 2019 01:50:24 -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 S1731181AbfHOIsR (ORCPT + 99 others); Thu, 15 Aug 2019 04:48:17 -0400 Received: from inva021.nxp.com ([92.121.34.21]:60338 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730456AbfHOIrs (ORCPT ); Thu, 15 Aug 2019 04:47:48 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E0D4320028A; Thu, 15 Aug 2019 10:47:46 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 36078200035; Thu, 15 Aug 2019 10:47:38 +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 60F3C40313; Thu, 15 Aug 2019 16:47:27 +0800 (SGT) From: Xiaowei Bao To: jingoohan1@gmail.com, gustavo.pimentel@synopsys.com, bhelgaas@google.com, robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, leoyang.li@nxp.com, kishon@ti.com, lorenzo.pieralisi@arm.com, arnd@arndb.de, gregkh@linuxfoundation.org, minghuan.Lian@nxp.com, mingkai.hu@nxp.com, roy.zang@nxp.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: Xiaowei Bao Subject: [PATCH 03/10] PCI: designware-ep: Move the function of getting MSI capability forward Date: Thu, 15 Aug 2019 16:37:09 +0800 Message-Id: <20190815083716.4715-3-xiaowei.bao@nxp.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190815083716.4715-1-xiaowei.bao@nxp.com> References: <20190815083716.4715-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 --- 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 e3a7cdf..0c27c7b 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -631,6 +631,10 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) if (ret < 0) epc->pf_offset = 0; + ep->msi_cap = dw_pcie_ep_find_capability(pci, PCI_CAP_ID_MSI); + + ep->msix_cap = dw_pcie_ep_find_capability(pci, PCI_CAP_ID_MSIX); + if (ep->ops->ep_init) ep->ops->ep_init(ep); @@ -647,9 +651,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_ep_find_capability(pci, PCI_CAP_ID_MSI); - - ep->msix_cap = dw_pcie_ep_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