Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4476141rdb; Fri, 15 Sep 2023 03:34:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmXiF1S1p4XQVYOWgfSgnpg7e4ZetflESgcOV1Z6QCmnH5gqdNyBhXGHSf/4uI87EawY0A X-Received: by 2002:a05:6a20:d402:b0:153:4ea6:d127 with SMTP id il2-20020a056a20d40200b001534ea6d127mr1322643pzb.18.1694774082039; Fri, 15 Sep 2023 03:34:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694774082; cv=none; d=google.com; s=arc-20160816; b=y/9RlmrW6knfQIGhrw4cg/5sWsFTLDFzRdcsQtrMCjg9effkEusapqSVvYj4abdodp elz2vLIHv8IyyP4+UAWxZtFP7pyag4v89cHpLewyz0ifpI8WNmyl0AMqifHRYxosv6Vc UtRj1UJoODOwF1VgmqEgKeu0HUH7ypdUS8gEFx+79enFxwmflDrprUrPnweCiNy9YFOi SpiOSfoRCwNUi+1Fq/WTIYiVzRLqee/AUPnokY1y8b59HuDCOc/a/IcRgxmfbVH3ZLJE X69TNsLS6XIuaawVwQRvM1w4afY0Zx1uzFkpV5NMFa2/JOjIvRy9jhDOusr1B4I+CzB/ ZWjw== 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=y8d0C5dLtGb8zs8KQUIJy2R9+5DBPV29N8a8eZxYvuU=; b=0MyWTDkMha53pa1fSzwKV0jQ6Q1/KQH/D7CUWVf1d5oYpIutIxDxmWzMibvgNcNWE4 5X61DG8sSv3XHm+odDMzXDGf9gAFT8CTyhuvujyKHrit5KgIrcFU6yjPfFSeMkvhnD6t k0lE6UTPqy6fmpDthbMRTLCc10Ni1qfYGk0egjKjL1lTTcAnv+CL26J2XzMuTfJ6th8/ bEGqos5oPbTC4B3nTr2tkD3oAtQvRYWB8No7xjV8yw3OaRVYtIkKXuigPORVVfe2Cz14 zmK0AcAeC1+kahgqnEjQe39N05qDsmoJMRQbVKB2nZaDCdyh9Sr9813X67R/KdN2NGcY 4GwA== 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 p15-20020a170902ebcf00b001bf0917df73si3014175plg.581.2023.09.15.03.34.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 03:34:42 -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 B5F3683F530B; Fri, 15 Sep 2023 03:23:18 -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 S234382AbjIOKXM (ORCPT + 99 others); Fri, 15 Sep 2023 06:23:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234262AbjIOKXB (ORCPT ); Fri, 15 Sep 2023 06:23:01 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0A631FD0; Fri, 15 Sep 2023 03:22:55 -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 1E84A859E; Fri, 15 Sep 2023 18:22:54 +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, 15 Sep 2023 18:22:51 +0800 Received: from ubuntu.localdomain (113.72.144.67) by EXMBX171.cuchost.com (172.16.6.91) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Fri, 15 Sep 2023 18:22:49 +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: , , , , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Paul Walmsley , Palmer Dabbelt , Albert Ou , Philipp Zabel , Mason Huo , Leyfoon Tan , Kevin Xie , Minda Chen Subject: [PATCH v6 06/19] PCI: microchip: Change the argument of plda_pcie_setup_iomems() Date: Fri, 15 Sep 2023 18:22:30 +0800 Message-ID: <20230915102243.59775-7-minda.chen@starfivetech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230915102243.59775-1-minda.chen@starfivetech.com> References: <20230915102243.59775-1-minda.chen@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.144.67] 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, RCVD_IN_DNSWL_BLOCKED,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]); Fri, 15 Sep 2023 03:23:19 -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