From patchwork Fri Oct 20 10:43:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 156008 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp974378vqb; Fri, 20 Oct 2023 04:07:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFX71SuJUajufikf0g3N6mFAQpVknPbff5hqiY7w19GHyQ4fFkTf324SRjDWs+qK0RRRWhq X-Received: by 2002:a17:902:d4c7:b0:1c3:4361:ca18 with SMTP id o7-20020a170902d4c700b001c34361ca18mr1254936plg.5.1697800041979; Fri, 20 Oct 2023 04:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697800041; cv=none; d=google.com; s=arc-20160816; b=RRB6tho9d3nXE9RqffaKg8rRF/u9/SjS4VoGLeLGN6HwSLDRcBx++pTpgKyzfrEFqR PaP6IQY4dsso/pVPqtIe3zw5CB3UFqG/JkKImtYTwj6v1/npay8eUPxsvaXX8ifM+vMe HBI6czMOtw5mCdGHUEpLmCqhVdo22Od1oU1xyknYH9YuGFDG4DF0ANzCOGimEtMH2huY hx4e4JsQiu+fF3WgYZBOsgMHs8m694StF+6CcRwzM5bJzWR+otdmwqq+slYOM/Gsfx4G jPv1lKDXWpR1SDbddbZP9qDm4jehCb1Km+6KxLqxZnmhQoQ0dcupJXhLt2mswmxnXRnP 54qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=V+qu8rhtWEIaAmNm8JXk5prxMx9cqKqUMBXp5SpLcaE=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=oAf7dRLUObykT+bzI2SRWEmbJ2e0apkkBQ/tIKcU/Tid0y5+mlPMqQK2wxPn3q/UIR dq00LdCx+D+tse/Lsl/jlibDkEmD9vRgWlq9/iqgBwI+Y3Ph1KF3sUSaPJCf11P2TXbn RA+MgxqjQ3G1qkLurx+0a14kylMJGrcSVjK/UFksS8WaqJ9riYaL9C4AG6bLX16VhZyN PAVwTlMuQ5XIig2eROEedOsTDIs5YnZElib8xNTaz90NVx8PFMO8ZNlZ7mzWyElUXOn/ UhbjPn+I4lNXfz34HcwQRsdrdK/8ZPn7zSJYNULW7YM11dxS9rUG2uPFA2Pl2D+wMpZP YEFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j1-20020a170902da8100b001c470c5906bsi1613909plx.221.2023.10.20.04.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:07:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BD8268072582; Fri, 20 Oct 2023 04:06:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376938AbjJTLFy (ORCPT + 25 others); Fri, 20 Oct 2023 07:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377026AbjJTKnz (ORCPT ); Fri, 20 Oct 2023 06:43:55 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296B6D52; Fri, 20 Oct 2023 03:43:51 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id DDCEA24E373; Fri, 20 Oct 2023 18:43:49 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 20 Oct 2023 18:43:49 +0800 Received: from ubuntu.localdomain (183.27.99.123) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 20 Oct 2023 18:43:48 +0800 From: Minda Chen To: Conor Dooley , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Lorenzo Pieralisi , "Daire McNamara" , Emil Renner Berthing , Krzysztof Kozlowski CC: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v9 08/20] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Fri, 20 Oct 2023 18:43:29 +0800 Message-ID: <20231020104341.63157-9-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231020104341.63157-1-minda.chen@starfivetech.com> References: <20231020104341.63157-1-minda.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [183.27.99.123] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 20 Oct 2023 04:06:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780272376476658992 X-GMAIL-MSGID: 1780272376476658992 If other vendor do not select PCI_HOST_COMMON, The driver data is not struct pci_host_bridge. Move calling platform_get_drvdata() to mc_platform_init(). Signed-off-by: Minda Chen Reviewed-by: Conor Dooley --- drivers/pci/controller/plda/pcie-microchip-host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c index 4877d130ee4c..31ca8d44ee2a 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -876,11 +876,10 @@ static void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index, writel(0, bridge_base_addr + ATR0_PCIE_WIN0_SRC_ADDR); } -static int plda_pcie_setup_iomems(struct platform_device *pdev, +static int plda_pcie_setup_iomems(struct pci_host_bridge *bridge, struct plda_pcie_rp *port) { void __iomem *bridge_base_addr = port->bridge_addr; - struct pci_host_bridge *bridge = platform_get_drvdata(pdev); struct resource_entry *entry; u64 pci_addr; u32 index = 1; @@ -1018,6 +1017,7 @@ static int mc_platform_init(struct pci_config_window *cfg) { struct device *dev = cfg->parent; struct platform_device *pdev = to_platform_device(dev); + struct pci_host_bridge *bridge = platform_get_drvdata(pdev); void __iomem *bridge_base_addr = port->axi_base_addr + MC_PCIE_BRIDGE_ADDR; int ret; @@ -1031,7 +1031,7 @@ static int mc_platform_init(struct pci_config_window *cfg) mc_pcie_enable_msi(port, cfg->win); /* Configure non-config space outbound ranges */ - ret = plda_pcie_setup_iomems(pdev, &port->plda); + ret = plda_pcie_setup_iomems(bridge, &port->plda); if (ret) return ret;