From patchwork Fri Sep 15 10:22:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minda Chen X-Patchwork-Id: 140330 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp941292vqi; Fri, 15 Sep 2023 03:28:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHq/8hkkPuEnTZa/mua6XtYgHMId0hapAmdfV7qQrjAbOp5DTS6CWUrLkqfhWSt1HOtR027 X-Received: by 2002:a05:6a00:22d1:b0:68e:3772:4e40 with SMTP id f17-20020a056a0022d100b0068e37724e40mr1436754pfj.3.1694773693841; Fri, 15 Sep 2023 03:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694773693; cv=none; d=google.com; s=arc-20160816; b=T55VM/hlgbz1syS/uEx2JF0/5+2St+OHnFVdl/vHLL3bMUWZXiu0OJNsIDxMJq4RdP Bo7f+XWh9nzXW7BrMDIAKNvtCb4hiU5ZzhFFrdkvoWY/HmZ0AKINyuWXK5rqIEVQiWDj U9HBP3bZyvFtEeh2G0/QO6Dog0sXeCRpDtn8dyIwMMfTOh30zvg2tW43flkJMzWNvdA0 y2WbbWnnd5VSjwSMiuhG8Mgejyv04sCxExp4sRAQs/yIegBPeSsWbjyYphf11Hl0K04H 3quoVl9s5ynmA6NheurOX3zaFLmTa3BYTzS7qjokeJvwkd08SeWHNbhSvUI5eJkuvHSH t1Ig== 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.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h18-20020a056a00231200b0068feb1cf986si3266553pfh.241.2023.09.15.03.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 03:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 02F0583174AF; Fri, 15 Sep 2023 03:23:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234393AbjIOKXN (ORCPT + 32 others); Fri, 15 Sep 2023 06:23:13 -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_Wilczy=C5=84?= =?utf-8?q?ski?= , Emil Renner Berthing CC: , , , , =?utf-8?q?P?= =?utf-8?q?ali_Roh=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 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=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:23:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777099020375277207 X-GMAIL-MSGID: 1777099020375277207 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;