From patchwork Wed Dec 6 10:58:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 174486 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4023844vqy; Wed, 6 Dec 2023 02:59:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IET8D2hBHvRDlhVvyEIvy6jUVnJI/DLmE5LtwxqEYEHYo/Lm/dDCBBIcA/6n1tyU3mgYyfG X-Received: by 2002:a17:90a:17eb:b0:286:8abc:e66 with SMTP id q98-20020a17090a17eb00b002868abc0e66mr913357pja.42.1701860354894; Wed, 06 Dec 2023 02:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701860354; cv=none; d=google.com; s=arc-20160816; b=jHZ4WbBnnVAd6xwcNeOXXyINNwi/yarlaj/Zy8tOfsVcjK+ECgJqTb2/9Bhes3qmmf Yqz9s25mjCyYsi2Xv2dC07BvOUeqzTdyT9cQjHZwdM0mEIlllfmJHxqviUQiRSGfjOlU Jkw5N1089fOlbkmet6qKn28jE5qZeJ2rnpq/ravKy2YUHmgYPwLrUOHi5DJ2AY3LTXJp R2QnbUvm5idzx74CytOZ6rwmN3Sr+bVtUFZSbiBhizRpXmRkYwYeEZtEZyZBYayYAD8N outvd2tJXa5VLRqMgE66IzN/MQcxkGRipOeQWbBWycCy28wo97ySqEvIIF2GqVYyLScl fkvw== 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=cgfkPQb7f+g7ZJvnguZG/7CgRmLdcowgDRIokNFhor3f3p82neh+2sXo91OWn6MbMi bBSQla807vO65wFaoC8gyirew4gNfs86JT478F1B3ga2jUZpjxQX58p3kKOeU7nSqoU/ OToIs2kcKPVYpPBXSdFVKP5wZuR3yf2NsZGoFbd4c1gUylqYrRjBYMUrQzXia8pyEITl NBiduUuJgoACFIGoQV4bdXE2fcUo82bBuoTAch8NBFJaWiUxpXjpnGOe5mrpYiUt//TX OaOGRkfn79ZFlHCgoXHwR1ZB5MHgMeINktYubQsrCsAvMMbRt/xBdzfn+oUsYiieB7a4 FXmg== 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:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id f8-20020a17090a9b0800b002859d83de02si11454551pjp.139.2023.12.06.02.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 02:59:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 04F6A8040380; Wed, 6 Dec 2023 02:59:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377892AbjLFK7D (ORCPT + 99 others); Wed, 6 Dec 2023 05:59:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377838AbjLFK7B (ORCPT ); Wed, 6 Dec 2023 05:59:01 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 773161BD; Wed, 6 Dec 2023 02:58:54 -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 fd01.gateway.ufhost.com (Postfix) with ESMTP id 9FDE180C7; Wed, 6 Dec 2023 18:58:49 +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, 6 Dec 2023 18:58:49 +0800 Received: from ubuntu.localdomain (183.27.97.199) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 18:58: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 v12 08/21] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Wed, 6 Dec 2023 18:58:26 +0800 Message-ID: <20231206105839.25805-9-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231206105839.25805-1-minda.chen@starfivetech.com> References: <20231206105839.25805-1-minda.chen@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [183.27.97.199] 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=-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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 06 Dec 2023 02:59:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784529923440441797 X-GMAIL-MSGID: 1784529923440441797 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;