Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2457681rdh; Wed, 27 Sep 2023 03:20:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERi7NsyNZ79BkrCiEUOghUFlZ2HRZQHCYsPAcAt8l97N285Zxd3aghHLOkTJQXYgFn/PLQ X-Received: by 2002:a05:6a20:2584:b0:15e:9923:3e35 with SMTP id k4-20020a056a20258400b0015e99233e35mr8474582pzd.19.1695810054119; Wed, 27 Sep 2023 03:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695810054; cv=none; d=google.com; s=arc-20160816; b=v3nVuDwhg0dvN7IFK1+yigQvnpvMqn+s2o4M9+53Jl4Pr4bXVPL3KhJuf6j+mLPm0g hYJ5EC8YV0n5+aUNYnoVaUC76tkG/8mTM8xa86HvG9vF3+cGh7WBuWOYSJv/TcJtMe7X pyX+QAK9C5Dq1jzR+T9yVKdZA1m+RQ2KO9nQ9ItuJLSrnJtyDroZZXmN/dCNVp++dJPk UkEftH9orDsK1sht+19eSV2JafesYtgIiZ9CRRxllmZYLPrTtqICXqRVAyJqi6N6Y1x3 rLj78nSWrg9Eg9vR2Bryf81/7vesXcwhPMSd76yPCJCHVlCxJMF3pCEAvKz9KZOggFZL 2Ccg== 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=1e9I8RxDgQdBm83IdAHJhykMZsj5dontBeyL8JJx81k=; fh=KH/9o+8UBz/NoIGu0llUr0msPOhSsaa+/ATeWBANkvM=; b=gSdPq5TQgIaxruSRTyqnZPrtlZwYz1nne589dwI9Xu/oUXsac2Qg+r7XoLZQ553wnA yWJjU04CrMTIY1NcwybENBA4T1MWGwPyeacW1OQpBaqmnco0yPLUqllCfV6eBR8Z9VqD fKwFX3nL97W43SgerPSr4ez87y/tFeWj7ubEhF7v5DyIbq4zgGUCccoC74psZnHUpAvF zBgGQYY+ghytUp7UugQJ2H5fFMwGqokmJtSAPaps19u2DGdoQS6pnXO5jqxO923Z3LbU XSheaVuJWlAfhao39V9UmsPliLCDpQnmnxAQN4aq2mzDL5JU+zuWDTYsPUWt9IXrbAvR jnPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v190-20020a6389c7000000b0054fd947f66dsi15427157pgd.210.2023.09.27.03.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 03:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 960198227793; Wed, 27 Sep 2023 03:08:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231222AbjI0KIe (ORCPT + 99 others); Wed, 27 Sep 2023 06:08:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230000AbjI0KIR (ORCPT ); Wed, 27 Sep 2023 06:08:17 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C78A912A; Wed, 27 Sep 2023 03:08:13 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id 1F15224DBD3; Wed, 27 Sep 2023 18:08:12 +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; Wed, 27 Sep 2023 18:08:12 +0800 Received: from ubuntu.localdomain (113.72.144.128) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 27 Sep 2023 18:08:10 +0800 From: Minda Chen To: Daire McNamara , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Bjorn Helgaas , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Emil Renner Berthing CC: , , , , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v7 06/19] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Wed, 27 Sep 2023 18:07:49 +0800 Message-ID: <20230927100802.46620-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230927100802.46620-1-minda.chen@starfivetech.com> References: <20230927100802.46620-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.128] 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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 (howler.vger.email [0.0.0.0]); Wed, 27 Sep 2023 03:08:47 -0700 (PDT) If other vendor do not select PCI_HOST_COMMON, The driver data is not struct pci_host_bridge. So 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 c83473e3cf9f..1d253acd6bc2 100644 --- a/drivers/pci/controller/plda/pcie-microchip-host.c +++ b/drivers/pci/controller/plda/pcie-microchip-host.c @@ -875,11 +875,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; @@ -1017,6 +1016,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; @@ -1030,7 +1030,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