Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2535793rdb; Wed, 15 Nov 2023 03:51:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IF+f6kR1T5vbLk3/MzdlSNnEC4GfnMm9wgprZma11EEMSgbyV2ztNSQStf6P3X60Mw/1Cw0 X-Received: by 2002:a05:6870:2009:b0:1f0:4108:bc87 with SMTP id o9-20020a056870200900b001f04108bc87mr14709069oab.19.1700049096639; Wed, 15 Nov 2023 03:51:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700049096; cv=none; d=google.com; s=arc-20160816; b=dpKJXTARuOi4fALeeqy+rpapfCSqSaAcHkKracsrRoHiAJZnSf+RvKF3JBqtNVoT5d +WitfscFf6fBXtx/NKgOH56u0UXKJnA52MKUHDqEdqqIIklRHNbuh09TgNIsgGJ/ppQ8 /La/OVFFq0hYo9p7m+xanuBLDwRnLkw2DD4TosyS/mUa3296UmXkDXnY8Hazqh7TWk41 62xFhYGsMoHQnGA8P7pkFwaC4iln1XY9eYUF0JOz658DGu4L+x4BNC/CICbwawK/fIKf jvCGvDQzxMw6z6w86fHOdaaFLqIlRoIcgKQIBRPxAnKNNNSC3HK5jjA+MTJuR/dceVsl 37wA== 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=GO+1rX1I4UT1MiT5u2qbeRFKm0W9wcXM4jsnuvUR7YM=; fh=ld3UXb1S5Y4IkunPfuj6e9Ppmc+fy6ncC+eQtrVLfK8=; b=MZj6ACWD2+w+JqtvV/cTtCeyQfOfalYwdrQ6PQ3Mpn7rqJdd6RWpystT/i0egFxoUU 5+hVP/DEwIvcZlb9Dg69WLuPfFFlV5DKb8hOr5q8uuvNHiKDZyNWkq3uC5XUPOQymEO3 fgnKxokYjw++xfRE32ql0SLEZkVKWbk2I6vZKgUY7+6w/LQe4SIIF5xWOLDn8nF5Y5qz Mjeyi0/mkgHqOeQcTz8cVWSpC6zNsaBFU0XL+P8WecT0df9O21IHPyCs/MhoA3Xk4/Xo wOH/4o8jeL2wn2z/R1SnP95AXZetoP7TZBOt9D0Fg11/rPr9zhPacsWCVk6sK3f/eBtW JDAg== 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:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id r3-20020a632b03000000b005b9a45633ffsi9917695pgr.446.2023.11.15.03.51.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 03:51:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 94B13802B3E3; Wed, 15 Nov 2023 03:51:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343696AbjKOLuN (ORCPT + 99 others); Wed, 15 Nov 2023 06:50:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343620AbjKOLtb (ORCPT ); Wed, 15 Nov 2023 06:49:31 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71F5913D; Wed, 15 Nov 2023 03:49:28 -0800 (PST) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id BC4F824E2D8; Wed, 15 Nov 2023 19:49:21 +0800 (CST) Received: from EXMBX171.cuchost.com (172.16.6.91) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 15 Nov 2023 19:49:21 +0800 Received: from ubuntu.localdomain (183.27.97.246) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 15 Nov 2023 19:49:20 +0800 From: Minda Chen To: Conor Dooley , =?UTF-8?q?Krzysztof=20Wilczy=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 v11 08/20] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Wed, 15 Nov 2023 19:49:00 +0800 Message-ID: <20231115114912.71448-9-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231115114912.71448-1-minda.chen@starfivetech.com> References: <20231115114912.71448-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [183.27.97.246] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX171.cuchost.com (172.16.6.91) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 03:51:17 -0800 (PST) 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; -- 2.17.1